code: def dump(schema):
      
      result = {}
  
      for name, _ in iteritems(schema.getschemas()):
  
          if hasattr(schema, name):
              val = getattr(schema, name)
  
              if isinstance(val, DynamicValue):
                  val = val()
  
              if isinstance(val, Schema):
                  val = dump(val)
  
              result[name] = val
  
      return result
docs: Get a serialized value of input schema.
  
      :param Schema schema: schema to serialize.
      :rtype: dict