'Return all structures that specified in ``ids``.
If a structure with the same id is in both the cache and the database,
the cached version will be preferred.
Arguments:
ids (list): A list of structure ids'

def find_structures_by_id(self, ids):

    structures = []
    ids = set(ids)
    for (_, record) in self._active_records:
        for structure in record.structures.values():
            structure_id = structure.get('_id')
            if (structure_id in ids):
                ids.remove(structure_id)
                structures.append(structure)
    structures.extend(self.db_connection.find_structures_by_id(list(ids)))
    return structures
