code: def obj_ref(obj):
      
      from indico_livesync.models.queue import EntryType
      if isinstance(obj, Category):
          ref = {'type': EntryType.category, 'category_id': obj.id}
      elif isinstance(obj, Event):
          ref = {'type': EntryType.event, 'event_id': obj.id}
      elif isinstance(obj, Session):
          ref = {'type': EntryType.session, 'session_id': obj.id}
      elif isinstance(obj, Contribution):
          ref = {'type': EntryType.contribution, 'contrib_id': obj.id}
      elif isinstance(obj, SubContribution):
          ref = {'type': EntryType.subcontribution, 'subcontrib_id': obj.id}
      else:
          raise ValueError('Unexpected object: {}'.format(obj.__class__.__name__))
      return ImmutableDict(ref)
docs: Returns a tuple identifying a category/event/contrib/subcontrib