code: def write_schema_to_file(cls, schema, file_pointer=stdout,
                               folder=MISSING, context=DEFAULT_DICT):
          
          schema = cls._get_schema(schema)
          json_schema = cls.generate_json_schema(schema, context=context)
  
          if folder:
              schema_filename = getattr(
                  schema.Meta,
                  'json_schema_filename',
                  '.'.join([schema.__class__.__name__, 'json'])
              )
              json_path = os.path.join(folder, schema_filename)
              file_pointer = open(json_path, 'w')
  
          json.dump(json_schema, file_pointer, indent=2)
  
          return json_schema
docs: Given a Marshmallow schema, create a JSON Schema for it.
  
          Args:
              schema (marshmallow.Schema|str): The Marshmallow schema, or the
                  Python path to one, to create the JSON schema for.
  
          Keyword Args:
              file_pointer (file, optional): The pointer to the file to write
                  this schema to. If not provided, the schema will be dumped to
                  ``sys.stdout``.
              folder (str, optional): The folder in which to save the JSON
                  schema. The name of the schema file can be optionally
                  controlled my the schema's ``Meta.json_schema_filename``. If
                  that attribute is not set, the class's name will be used for
                  the filename. If writing the schema to a specific file is
                  desired, please pass in a ``file_pointer``.
              context (dict, optional): The Marshmallow context to be pushed to
                  the schema generates the JSONSchema.
  
          Returns:
              dict: The JSON schema in dictionary form.