def _list_files_wo_replicas(files_wo_replica, session):
    if files_wo_replica:
        file_wo_clause = []
        for file in sorted(files_wo_replica, key=(lambda f: (f['scope'], f['name']))):
            file_wo_clause.append(and_((models.DataIdentifier.scope == file['scope']), (models.DataIdentifier.name == file['name'])))
        files_wo_replicas_query = session.query(models.DataIdentifier.scope, models.DataIdentifier.name, models.DataIdentifier.bytes, models.DataIdentifier.md5, models.DataIdentifier.adler32).filter_by(did_type=DIDType.FILE).filter(or_(*file_wo_clause)).with_hint(models.DataIdentifier, text='INDEX(DIDS DIDS_PK)', dialect_name='oracle')
        for (scope, name, bytes, md5, adler32) in files_wo_replicas_query:
            (yield (scope, name, bytes, md5, adler32))
def _list_files_wo_replicas(files_wo_replica, session):
    if files_wo_replica:
        file_wo_clause = []
        for file in sorted(files_wo_replica, key=(lambda f: (f['scope'], f['name']))):
            file_wo_clause.append(and_((models.DataIdentifier.scope == file['scope']), (models.DataIdentifier.name == file['name'])))
        files_wo_replicas_query = session.query(models.DataIdentifier.scope, models.DataIdentifier.name, models.DataIdentifier.bytes, models.DataIdentifier.md5, models.DataIdentifier.adler32).filter_by(did_type=DIDType.FILE).filter(or_(*file_wo_clause)).with_hint(models.DataIdentifier, text='INDEX(DIDS DIDS_PK)', dialect_name='oracle')
        for (scope, name, bytes, md5, adler32) in files_wo_replicas_query:
            (yield (scope, name, bytes, md5, adler32))