parameters: (self, schema)
return_statement: return self.string
docstring: Prototype object based on the schema, in Python code with comments.
  
      Args:
        schema: object, Parsed JSON schema file.
  
      Returns:
        Prototype object based on the schema, in Python code with comments.
docstring_summary: Prototype object based on the schema, in Python code with comments.
docstring_tokens: Prototype object based on the schema in Python code with comments .
function: def _to_str_impl(self, schema):
      """Prototype object based on the schema, in Python code with comments.
  
      Args:
        schema: object, Parsed JSON schema file.
  
      Returns:
        Prototype object based on the schema, in Python code with comments.
      """
      stype = schema.get('type')
      if stype == 'object':
        self.emitEnd('{', schema.get('description', ''))
        self.indent()
        if 'properties' in schema:
          for pname, pschema in six.iteritems(schema.get('properties', {})):
            self.emitBegin('"%s": ' % pname)
            self._to_str_impl(pschema)
        elif 'additionalProperties' in schema:
          self.emitBegin('"a_key": ')
          self._to_str_impl(schema['additionalProperties'])
        self.undent()
        self.emit('},')
      elif '$ref' in schema:
        schemaName = schema['$ref']
        description = schema.get('description', '')
        s = self.from_cache(schemaName, seen=self.seen)
        parts = s.splitlines()
        self.emitEnd(parts[0], description)
        for line in parts[1:]:
          self.emit(line.rstrip())
      elif stype == 'boolean':
        value = schema.get('default', 'True or False')
        self.emitEnd('%s,' % str(value), schema.get('description', ''))
      elif stype == 'string':
        value = schema.get('default', 'A String')
        self.emitEnd('"%s",' % str(value), schema.get('description', ''))
      elif stype == 'integer':
        value = schema.get('default', '42')
        self.emitEnd('%s,' % str(value), schema.get('description', ''))
      elif stype == 'number':
        value = schema.get('default', '3.14')
        self.emitEnd('%s,' % str(value), schema.get('description', ''))
      elif stype == 'null':
        self.emitEnd('None,', schema.get('description', ''))
      elif stype == 'any':
        self.emitEnd('"",', schema.get('description', ''))
      elif stype == 'array':
        self.emitEnd('[', schema.get('description'))
        self.indent()
        self.emitBegin('')
        self._to_str_impl(schema['items'])
        self.undent()
        self.emit('],')
      else:
        self.emit('Unknown type! %s' % stype)
        self.emitEnd('', '')
  
      self.string = ''.join(self.value)
      return self.string
function_tokens: def _to_str_impl ( self , schema ) : stype = schema . get ( 'type' ) if stype == 'object' : self . emitEnd ( '{' , schema . get ( 'description' , '' ) ) self . indent ( ) if 'properties' in schema : for pname , pschema in six . iteritems ( schema . get ( 'properties' , { } ) ) : self . emitBegin ( '"%s": ' % pname ) self . _to_str_impl ( pschema ) elif 'additionalProperties' in schema : self . emitBegin ( '"a_key": ' ) self . _to_str_impl ( schema [ 'additionalProperties' ] ) self . undent ( ) self . emit ( '},' ) elif '$ref' in schema : schemaName = schema [ '$ref' ] description = schema . get ( 'description' , '' ) s = self . from_cache ( schemaName , seen = self . seen ) parts = s . splitlines ( ) self . emitEnd ( parts [ 0 ] , description ) for line in parts [ 1 : ] : self . emit ( line . rstrip ( ) ) elif stype == 'boolean' : value = schema . get ( 'default' , 'True or False' ) self . emitEnd ( '%s,' % str ( value ) , schema . get ( 'description' , '' ) ) elif stype == 'string' : value = schema . get ( 'default' , 'A String' ) self . emitEnd ( '"%s",' % str ( value ) , schema . get ( 'description' , '' ) ) elif stype == 'integer' : value = schema . get ( 'default' , '42' ) self . emitEnd ( '%s,' % str ( value ) , schema . get ( 'description' , '' ) ) elif stype == 'number' : value = schema . get ( 'default' , '3.14' ) self . emitEnd ( '%s,' % str ( value ) , schema . get ( 'description' , '' ) ) elif stype == 'null' : self . emitEnd ( 'None,' , schema . get ( 'description' , '' ) ) elif stype == 'any' : self . emitEnd ( '"",' , schema . get ( 'description' , '' ) ) elif stype == 'array' : self . emitEnd ( '[' , schema . get ( 'description' ) ) self . indent ( ) self . emitBegin ( '' ) self . _to_str_impl ( schema [ 'items' ] ) self . undent ( ) self . emit ( '],' ) else : self . emit ( 'Unknown type! %s' % stype ) self . emitEnd ( '' , '' ) self . string = '' . join ( self . value ) return self . string