<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def obj_deref(ref):
 """Returns the object identified by `ref`"""

    from indico_livesync.models.queue import EntryType
    if ref['type'] == EntryType.category:
        return Category.get_one(ref['category_id'])
    elif ref['type'] == EntryType.event:
        return Event.get_one(ref['event_id'])
    elif ref['type'] == EntryType.session:
        return Session.get_one(ref['session_id'])
    elif ref['type'] == EntryType.contribution:
        return Contribution.get_one(ref['contrib_id'])
    elif ref['type'] == EntryType.subcontribution:
        return SubContribution.get_one(ref['subcontrib_id'])
    else:
        raise ValueError('Unexpected object type: {}'.format(ref['type']))