code: def test_pipe_factories_from_source_language_subclass():
      class CustomEnglishDefaults(English.Defaults):
          stop_words = set(["custom", "stop"])
  
      @registry.languages("custom_en")
      class CustomEnglish(English):
          lang = "custom_en"
          Defaults = CustomEnglishDefaults
  
      source_nlp = English()
      source_nlp.add_pipe("tagger")
  
      # custom subclass
      nlp = CustomEnglish()
      nlp.add_pipe("tagger", source=source_nlp)
      assert "tagger" in nlp.pipe_names
  
      # non-subclass
      nlp = German()
      nlp.add_pipe("tagger", source=source_nlp)
      assert "tagger" in nlp.pipe_names
  
      # mismatched vectors
      nlp = English()
      nlp.vocab.vectors.resize((1, 4))
      nlp.vocab.vectors.add("cat", vector=[1, 2, 3, 4])
      with pytest.warns(UserWarning):
          nlp.add_pipe("tagger", source=source_nlp)
  
imports: import pytest
  from thinc.api import ConfigValidationError, Linear, Model
  import spacy
  from spacy.lang.de import German
  from spacy.lang.en import English
  from spacy.language import Language
  from spacy.pipeline.tok2vec import DEFAULT_TOK2VEC_MODEL
  from spacy.tokens import Doc
  from spacy.util import SimpleFrozenDict, combine_score_weights, registry
  from ..util import make_tempdir
label_desc: Use image node_id 16 for calling a global function with example usage: test_pipe_factories_from_source_language_subclass() without return types