def _list_replicas_for_constituents(constituent_clause, state_clause, files_wo_replica, rse_clause, ignore_availability, updated_after, session):
    '\n    List file replicas for archive constituents.\n    '
    if (not constituent_clause):
        return
    constituent_query = session.query(models.ConstituentAssociation.child_scope, models.ConstituentAssociation.child_name, models.ConstituentAssociation.scope, models.ConstituentAssociation.name, models.ConstituentAssociation.bytes, models.ConstituentAssociation.md5, models.ConstituentAssociation.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').with_hint(models.ConstituentAssociation, 'INDEX(ARCHIVE_CONTENTS ARCH_CONTENTS_PK)', 'oracle').outerjoin(models.RSEFileAssociation, and_((models.ConstituentAssociation.scope == models.RSEFileAssociation.scope), (models.ConstituentAssociation.name == models.RSEFileAssociation.name))).join(models.RSE, (models.RSE.id == models.RSEFileAssociation.rse_id)).filter((models.RSE.deleted == false())).filter(or_(*constituent_clause)).order_by(models.ConstituentAssociation.child_scope, models.ConstituentAssociation.child_name)
    if (not ignore_availability):
        constituent_query = constituent_query.filter(models.RSE.availability.in_((4, 5, 6, 7)))
    if (state_clause is not None):
        constituent_query = constituent_query.filter(and_(state_clause))
    if (rse_clause is not None):
        constituent_query = constituent_query.filter(or_(*rse_clause))
    if updated_after:
        constituent_query = constituent_query.filter((models.RSEFileAssociation.updated_at >= updated_after))
    for replica in constituent_query.yield_per(500):
        (scope, name) = (replica[0], replica[1])
        (({'scope': scope, 'name': name} in files_wo_replica) and files_wo_replica.remove({'scope': scope, 'name': name}))
        (yield replica)
List file replicas for archive constituents.
def _list_replicas_for_constituents(constituent_clause, state_clause, files_wo_replica, rse_clause, ignore_availability, updated_after, session):
    '\n    \n    '
    if (not constituent_clause):
        return
    constituent_query = session.query(models.ConstituentAssociation.child_scope, models.ConstituentAssociation.child_name, models.ConstituentAssociation.scope, models.ConstituentAssociation.name, models.ConstituentAssociation.bytes, models.ConstituentAssociation.md5, models.ConstituentAssociation.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').with_hint(models.ConstituentAssociation, 'INDEX(ARCHIVE_CONTENTS ARCH_CONTENTS_PK)', 'oracle').outerjoin(models.RSEFileAssociation, and_((models.ConstituentAssociation.scope == models.RSEFileAssociation.scope), (models.ConstituentAssociation.name == models.RSEFileAssociation.name))).join(models.RSE, (models.RSE.id == models.RSEFileAssociation.rse_id)).filter((models.RSE.deleted == false())).filter(or_(*constituent_clause)).order_by(models.ConstituentAssociation.child_scope, models.ConstituentAssociation.child_name)
    if (not ignore_availability):
        constituent_query = constituent_query.filter(models.RSE.availability.in_((4, 5, 6, 7)))
    if (state_clause is not None):
        constituent_query = constituent_query.filter(and_(state_clause))
    if (rse_clause is not None):
        constituent_query = constituent_query.filter(or_(*rse_clause))
    if updated_after:
        constituent_query = constituent_query.filter((models.RSEFileAssociation.updated_at >= updated_after))
    for replica in constituent_query.yield_per(500):
        (scope, name) = (replica[0], replica[1])
        (({'scope': scope, 'name': name} in files_wo_replica) and files_wo_replica.remove({'scope': scope, 'name': name}))
        (yield replica)