original_docstring: Generate a schema wrapper at the given path.
docstring: Generate a schema wrapper at the given path.
docstring_tokens: Generate a schema wrapper at the given path .
code: def generate_vegalite_schema_wrapper(schema_file):
      """Generate a schema wrapper at the given path."""
      # TODO: generate simple tests for each wrapper
      basename = 'VegaLiteSchema'
  
      with open(schema_file, encoding='utf8') as f:
          rootschema = json.load(f)
      contents = [HEADER,
                  "from altair.utils.schemapi import SchemaBase, Undefined",
                  LOAD_SCHEMA.format(schemafile='vega-lite-schema.json')]
      contents.append(BASE_SCHEMA.format(basename=basename))
      contents.append(schema_class('Root', schema=rootschema, basename=basename,
                                   schemarepr=CodeSnippet('load_schema()')))
  
      for name in rootschema['definitions']:
          defschema = {'$ref': '#/definitions/' + name}
          defschema_repr = {'$ref': '#/definitions/' + name}
  
          contents.append(schema_class(get_valid_identifier(name),
                                       schema=defschema, schemarepr=defschema_repr,
                                       rootschema=rootschema, basename=basename,
                                       rootschemarepr=CodeSnippet("Root._schema")))
      contents.append('')  # end with newline
      return '\n'.join(contents)
code_tokens: def generate_vegalite_schema_wrapper ( schema_file ) : basename = 'VegaLiteSchema' with open ( schema_file , encoding = 'utf8' ) as f : rootschema = json . load ( f ) contents = [ HEADER , "from altair.utils.schemapi import SchemaBase, Undefined" , LOAD_SCHEMA . format ( schemafile = 'vega-lite-schema.json' ) ] contents . append ( BASE_SCHEMA . format ( basename = basename ) ) contents . append ( schema_class ( 'Root' , schema = rootschema , basename = basename , schemarepr = CodeSnippet ( 'load_schema()' ) ) ) for name in rootschema [ 'definitions' ] : defschema = { '$ref' : '#/definitions/' + name } defschema_repr = { '$ref' : '#/definitions/' + name } contents . append ( schema_class ( get_valid_identifier ( name ) , schema = defschema , schemarepr = defschema_repr , rootschema = rootschema , basename = basename , rootschemarepr = CodeSnippet ( "Root._schema" ) ) ) contents . append ( '' ) return '\n' . join ( contents )
short_docstring: Generate a schema wrapper at the given path.
short_docstring_tokens: Generate a schema wrapper at the given path .
comment: """Generate a schema wrapper at the given path."""$SEP$# TODO: generate simple tests for each wrapper$SEP$# end with newline