class_docstr: A JSON notebook writer.
docstr: Convert a notebook to a string.
docstr_tok: ["Convert","a","notebook","to","a","string","."]
code: def writes(self, nb, **kwargs):
      """Convert a notebook to a string."""
      kwargs["cls"] = BytesEncoder
      kwargs["indent"] = 1
      kwargs["sort_keys"] = True
      kwargs["separators"] = (",", ": ")
      nb = copy.deepcopy(nb)
      nb = strip_transient(nb)
      if kwargs.pop("split_lines", True):
          nb = split_lines(nb)
      return json.dumps(nb, **kwargs)
  
file_path: nbformat/nbformat/v3/nbjson.py
imports: from __future__ import annotations
  import copy
  import json
  from .nbbase import from_dict
  from .rwbase import NotebookReader, NotebookWriter, rejoin_lines, split_lines, strip_transient
label_desc: Use image node_id 1 for calling the JSONWriter obj's underlying member method code with example usage: obj.writes(nb) and returns: json