code: def get_entry(entry):
      
  
      if hasattr(entry, 'id'):
          return entry
  
      if isinstance(entry, (int, str)):
          return model.Entry.get(id=int(entry))
      raise ValueError("entry is of unknown type {}".format(type(entry)))
docs: Helper function to get an entry by ID or by object