code: def test_tok2vec_frozen_not_annotating():
      """Test that a pipeline with a frozen tok2vec raises an error when the tok2vec is not annotating"""
      orig_config = Config().from_str(cfg_string)
      nlp = util.load_model_from_config(
          orig_config, auto_fill=True, validate=True
      )
      train_examples = []
      for t in TRAIN_DATA:
          train_examples.append(
              Example.from_dict(nlp.make_doc(t[0]), t[1])
          )
      optimizer = nlp.initialize(get_examples=lambda: train_examples)
  
      for i in range(2):
          losses = {}
          with pytest.raises(
              ValueError,
              match=r"the tok2vec embedding layer is not updated",
          ):
              nlp.update(
                  train_examples,
                  sgd=optimizer,
                  losses=losses,
                  exclude=["tok2vec"],
              )
  
imports: import pytest
  from numpy.testing import assert_array_equal
  from thinc.api import Config, get_current_ops
  from spacy import util
  from spacy.lang.en import English
  from spacy.ml.models.tok2vec import MaxoutWindowEncoder, MultiHashEmbed, build_Tok2Vec_model
  from spacy.pipeline.tok2vec import Tok2Vec, Tok2VecListener
  from spacy.tokens import Doc
  from spacy.training import Example
  from spacy.util import registry
  from spacy.vocab import Vocab
  from ..util import add_vecs_to_vocab, get_batch, make_tempdir
label_desc: Use image node_id 8 for calling a global function with example usage: test_tok2vec_frozen_not_annotating() without return types