code: def test_connected_two_tag_training(pretrain_file, tmp_path):
      trainer = run_two_tag_training(
          pretrain_file, tmp_path, "--connect_output_layers"
      )
      assert len(trainer.model.tag_clfs) == 2
      assert len(trainer.model.crits) == 2
      assert len(trainer.vocab["tag"].lens()) == 2
  
      # this checks that with the connected output layers,
      # the second output layer has its size increased
      # by the number of tags known to the first output layer
      assert (
          trainer.model.tag_clfs[1].weight.shape[1]
          == trainer.vocab["tag"].lens()[0]
          + trainer.model.tag_clfs[0].weight.shape[1]
      )
  
imports: import json
  import logging
  import os
  import warnings
  import pytest
  import torch
  from stanza.models import ner_tagger
  from stanza.models.ner.trainer import Trainer
  from stanza.tests import TEST_WORKING_DIR
  from stanza.utils.datasets.ner.prepare_ner_file import process_dataset
label_desc: Use image node_id 9 for calling a global function with example usage: test_connected_two_tag_training(pretrain_file, tmp_path) without return types