def _list_replicas_for_datasets(dataset_clause, state_clause, rse_clause, ignore_availability, updated_after, session):
    '\n    List file replicas for a list of datasets.\n\n    :param session: The database session in use.\n    '
    if (not dataset_clause):
        return
    replica_query = session.query(models.DataIdentifierAssociation.child_scope, models.DataIdentifierAssociation.child_name, models.DataIdentifierAssociation.bytes, models.DataIdentifierAssociation.md5, models.DataIdentifierAssociation.adler32, models.RSEFileAssociation.path, models.RSEFileAssociation.state, models.RSE.id, models.RSE.rse, models.RSE.rse_type, models.RSE.volatile).with_hint(models.RSEFileAssociation, text='INDEX_RS_ASC(CONTENTS CONTENTS_PK) INDEX_RS_ASC(REPLICAS REPLICAS_PK) NO_INDEX_FFS(CONTENTS CONTENTS_PK)', dialect_name='oracle').outerjoin(models.RSEFileAssociation, and_((models.DataIdentifierAssociation.child_scope == models.RSEFileAssociation.scope), (models.DataIdentifierAssociation.child_name == models.RSEFileAssociation.name))).join(models.RSE, (models.RSE.id == models.RSEFileAssociation.rse_id)).filter((models.RSE.deleted == false())).filter(or_(*dataset_clause)).order_by(models.DataIdentifierAssociation.child_scope, models.DataIdentifierAssociation.child_name)
    if (not ignore_availability):
        replica_query = replica_query.filter(models.RSE.availability.in_((4, 5, 6, 7)))
    if (state_clause is not None):
        replica_query = replica_query.filter(and_(state_clause))
    if (rse_clause is not None):
        replica_query = replica_query.filter(or_(*rse_clause))
    if updated_after:
        replica_query = replica_query.filter((models.RSEFileAssociation.updated_at >= updated_after))
    for (scope, name, bytes, md5, adler32, path, state, rse_id, rse, rse_type, volatile) in replica_query.yield_per(500):
        (yield (scope, name, None, None, bytes, md5, adler32, path, state, rse_id, rse, rse_type, volatile))
List file replicas for a list of datasets.

:param session: The database session in use.
def _list_replicas_for_datasets(dataset_clause, state_clause, rse_clause, ignore_availability, updated_after, session):
    '\n    List file replicas for a list of datasets.\n\n    :param session: The database session in use.\n    '
    if (not dataset_clause):
        return
    replica_query = session.query(models.DataIdentifierAssociation.child_scope, models.DataIdentifierAssociation.child_name, models.DataIdentifierAssociation.bytes, models.DataIdentifierAssociation.md5, models.DataIdentifierAssociation.adler32, models.RSEFileAssociation.path, models.RSEFileAssociation.state, models.RSE.id, models.RSE.rse, models.RSE.rse_type, models.RSE.volatile).with_hint(models.RSEFileAssociation, text='INDEX_RS_ASC(CONTENTS CONTENTS_PK) INDEX_RS_ASC(REPLICAS REPLICAS_PK) NO_INDEX_FFS(CONTENTS CONTENTS_PK)', dialect_name='oracle').outerjoin(models.RSEFileAssociation, and_((models.DataIdentifierAssociation.child_scope == models.RSEFileAssociation.scope), (models.DataIdentifierAssociation.child_name == models.RSEFileAssociation.name))).join(models.RSE, (models.RSE.id == models.RSEFileAssociation.rse_id)).filter((models.RSE.deleted == false())).filter(or_(*dataset_clause)).order_by(models.DataIdentifierAssociation.child_scope, models.DataIdentifierAssociation.child_name)
    if (not ignore_availability):
        replica_query = replica_query.filter(models.RSE.availability.in_((4, 5, 6, 7)))
    if (state_clause is not None):
        replica_query = replica_query.filter(and_(state_clause))
    if (rse_clause is not None):
        replica_query = replica_query.filter(or_(*rse_clause))
    if updated_after:
        replica_query = replica_query.filter((models.RSEFileAssociation.updated_at >= updated_after))
    for (scope, name, bytes, md5, adler32, path, state, rse_id, rse, rse_type, volatile) in replica_query.yield_per(500):
        (yield (scope, name, None, None, bytes, md5, adler32, path, state, rse_id, rse, rse_type, volatile))