code: def test_pipe_labels(nlp):
      input_labels = {
          "ner": ["PERSON", "ORG", "GPE"],
          "textcat": ["POSITIVE", "NEGATIVE"],
      }
      for name, labels in input_labels.items():
          nlp.add_pipe(name)
          pipe = nlp.get_pipe(name)
          for label in labels:
              pipe.add_label(label)
          assert len(pipe.labels) == len(labels)
  
      assert len(nlp.pipe_labels) == len(input_labels)
      for name, labels in nlp.pipe_labels.items():
          assert sorted(input_labels[name]) == sorted(labels)
  
imports: import gc
  import numpy
  import pytest
  from thinc.api import get_current_ops
  import spacy
  from spacy.lang.en import English
  from spacy.lang.en.syntax_iterators import noun_chunks
  from spacy.language import Language
  from spacy.pipeline import TrainablePipe
  from spacy.tokens import Doc
  from spacy.training import Example
  from spacy.util import SimpleFrozenList, get_arg_names, make_tempdir
  from spacy.vocab import Vocab
label_desc: Use image node_id 30 for calling a global function with example usage: test_pipe_labels(nlp) without return types