code: def to_json(value, **kwargs):
          
          serial_dict = {
              key: (
                  val.serialize(**kwargs) if isinstance(val, HasProperties)
                  else val
              )
              for key, val in iteritems(value)
          }
          return serial_dict
docs: Return a copy of the dictionary
  
          If the values are HasProperties instances, they are serialized