def serialize_object(obj):
 if getattr(obj, 'to_dict', None):
  value = obj.to_dict()
 elif getattr(obj, 'to_serializable_dict', None):
  value = obj.to_serializable_dict(mask_secrets=True)
 else:
  value = repr(obj)
 return value

def serialize_object ( obj ) : if getattr ( obj , 'to_dict' , None ) : value = obj . to_dict ( ) elif getattr ( obj , 'to_serializable_dict' , None ) : value = obj . to_serializable_dict ( mask_secrets = True ) else : value = repr ( obj ) return value
serialize the provided object .