<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lease_to_id(lease):
 """Figure out if the argument is a Lease object, or the lease ID."""

    lease_id = 0
    if hasattr(lease, 'id'):
        lease_id = lease.id
    else:
        try:
            lease_id = int(lease)
        except TypeError:
            pass
    return lease_id