code: def test_doc_to_json_underscore(doc):
      Doc.set_extension("json_test1", default=False)
      Doc.set_extension("json_test2", default=False)
      doc._.json_test1 = "hello world"
      doc._.json_test2 = [1, 2, 3]
  
      json_doc = doc.to_json(underscore=["json_test1", "json_test2"])
      assert "_" in json_doc
      assert json_doc["_"]["json_test1"] == "hello world"
      assert json_doc["_"]["json_test2"] == [1, 2, 3]
      assert len(schemas.validate(schemas.DocJSONSchema, json_doc)) == 0
      assert srsly.json_loads(srsly.json_dumps(json_doc)) == json_doc
  
imports: import pytest
  import srsly
  import spacy
  from spacy import schemas
  from spacy.tokens import Doc, Span, Token
  from .test_underscore import clean_underscore
label_desc: Use image node_id 5 for calling a global function with example usage: test_doc_to_json_underscore(doc) without return types