@transactional_session
def __bulk_add_file_dids(files, account, dataset_meta=None, session=None):
    '\n    Bulk add new dids.\n\n    :param dids: the list of files.\n    :param account: The account owner.\n    :param session: The database session in use.\n    :returns: True is successful.\n    '
    condition = []
    for f in files:
        condition.append(and_((models.DataIdentifier.scope == f['scope']), (models.DataIdentifier.name == f['name']), (models.DataIdentifier.did_type == DIDType.FILE)))
    q = session.query(models.DataIdentifier.scope, models.DataIdentifier.name, models.DataIdentifier.bytes, models.DataIdentifier.adler32, models.DataIdentifier.md5).with_hint(models.DataIdentifier, 'INDEX(dids DIDS_PK)', 'oracle').filter(or_(*condition))
    available_files = [dict([(column, getattr(row, column)) for column in row._fields]) for row in q]
    new_files = list()
    for file in files:
        found = False
        for available_file in available_files:
            if ((file['scope'] == available_file['scope']) and (file['name'] == available_file['name'])):
                found = True
                break
        if (not found):
            new_files.append(file)
    __bulk_add_new_file_dids(files=new_files, account=account, dataset_meta=dataset_meta, session=session)
    return (new_files + available_files)
Bulk add new dids.

:param dids: the list of files.
:param account: The account owner.
:param session: The database session in use.
:returns: True is successful.
@transactional_session
def __bulk_add_file_dids(files, account, dataset_meta=None, session=None):
    '\n    Bulk add new dids.\n\n    :param dids: the list of files.\n    :param account: The account owner.\n    :param session: The database session in use.\n    :returns: True is successful.\n    '
    condition = []
    for f in files:
        condition.append(and_((models.DataIdentifier.scope == f['scope']), (models.DataIdentifier.name == f['name']), (models.DataIdentifier.did_type == DIDType.FILE)))
    q = session.query(models.DataIdentifier.scope, models.DataIdentifier.name, models.DataIdentifier.bytes, models.DataIdentifier.adler32, models.DataIdentifier.md5).with_hint(models.DataIdentifier, 'INDEX(dids DIDS_PK)', 'oracle').filter(or_(*condition))
    available_files = [dict([(column, getattr(row, column)) for column in row._fields]) for row in q]
    new_files = list()
    for file in files:
        found = False
        for available_file in available_files:
            if ((file['scope'] == available_file['scope']) and (file['name'] == available_file['name'])):
                found = True
                break
        if (not found):
            new_files.append(file)
    __bulk_add_new_file_dids(files=new_files, account=account, dataset_meta=dataset_meta, session=session)
    return (new_files + available_files)