'Return all definitions that specified in ``ids``.
If a definition with the same id is in both the cache and the database,
the cached version will be preferred.
Arguments:
course_key (:class:`.CourseKey`): The course that these definitions are being loaded
for (to respect bulk operations).
ids (list): A list of definition ids'

def get_definitions(self, course_key, ids):

    definitions = []
    ids = set(ids)
    bulk_write_record = self._get_bulk_ops_record(course_key)
    if bulk_write_record.active:
        for definition in bulk_write_record.definitions.values():
            definition_id = definition.get('_id')
            if (definition_id in ids):
                ids.remove(definition_id)
                definitions.append(definition)
    if len(ids):
        defs_from_db = list(self.db_connection.get_definitions(list(ids), course_key))
        defs_dict = {d.get('_id'): d for d in defs_from_db}
        bulk_write_record.definitions_in_db.update(defs_dict.iterkeys())
        bulk_write_record.definitions.update(defs_dict)
        definitions.extend(defs_from_db)
    return definitions
