code: def test_init_nlp(config_string):
      @spacy.registry.readers.register("toy_tagger_data.v1")
      def read_tagger_data():
          def parse_data(nlp, index):
              ex = TRAIN_TAGGER_DATA[index]
              yield Example.from_dict(nlp.make_doc(ex[0]), ex[1])
  
          return {
              "train": partial(parse_data, index=0),
              "dev": partial(parse_data, index=1),
          }
  
      config = spacy.util.load_config_from_str(
          config_string, interpolate=False
      )
      config = Config(
          DEFAULT_CONFIG, section_order=CONFIG_SECTION_ORDER
      ).merge(config)
      nlp = init_nlp(config, use_gpu=False)
      assert nlp is not None
  
      tagger = nlp.get_pipe("tagger")
      transformer = nlp.get_pipe("custom_transformer")
      tagger_trf = tagger.model.get_ref("tok2vec").layers[0]
      assert tagger_trf.upstream_name == "custom_transformer"
      assert transformer.listeners[0] == tagger_trf
  
file_path: spacy-transformers/spacy_transformers/tests/test_configs.py
imports: from functools import partial
  import pytest
  import spacy
  from spacy.training import Example
  from spacy.training.initialize import init_nlp
  from spacy.util import CONFIG_SECTION_ORDER
  from spacy.language import DEFAULT_CONFIG
  from thinc.config import Config
label_desc: Use image node_id 1 for calling a global function with example usage: test_init_nlp(config_string) and returns: dict