code: def lease_to_id(lease):
      
      lease_id = 0
      if hasattr(lease, 'id'):
          lease_id = lease.id
      else:
          try:
              lease_id = int(lease)
          except TypeError:
              pass
      return lease_id
docs: Figure out if the argument is a Lease object, or the lease ID.