'Transforms the object to a Python dictionary.
Note:
If an Input hasn\'t been signed yet, this method returns a
dictionary representation.
Returns:
dict: The Input as an alternative serialization format.'

def to_dict(self):

    try:
        fulfillment = self.fulfillment.serialize_uri()
    except (TypeError, AttributeError, ASN1EncodeError):
        fulfillment = _fulfillment_to_details(self.fulfillment)
    try:
        fulfills = self.fulfills.to_dict()
    except AttributeError:
        fulfills = None
    input_ = {'owners_before': self.owners_before, 'fulfills': fulfills, 'fulfillment': fulfillment}
    return input_
