<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_entry(entry):
 """ Helper function to get an entry by ID or by object """


    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)))