<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def contract_to_dict(contract):
 """Convert an IBPy Contract object to a dict containing any non-default values."""

    default = Contract()
    return {field: val for field, val in vars(contract).items() if val != getattr(default, field, None)}