code: def get_tensorizers(add_dict_feat=False, add_contextual_feat=False):
      schema = {
          "source_sequence": str,
          "dict_feat": Gazetteer,
          "target_sequence": str,
      }
      data_source = TSVDataSource.from_config(
          TSVDataSource.Config(
              train_filename=TEST_FILE_NAME,
              field_names=[
                  "source_sequence",
                  "dict_feat",
                  "target_sequence",
              ],
          ),
          schema,
      )
      src_tensorizer = TokenTensorizer.from_config(
          TokenTensorizer.Config(
              column="source_sequence",
              add_eos_token=True,
              add_bos_token=True,
          )
      )
      tgt_tensorizer = TokenTensorizer.from_config(
          TokenTensorizer.Config(
              column="target_sequence",
              add_eos_token=True,
              add_bos_token=True,
          )
      )
      tensorizers = {
          "src_seq_tokens": src_tensorizer,
          "trg_seq_tokens": tgt_tensorizer,
      }
      initialize_tensorizers(tensorizers, data_source.train)
  
      if add_dict_feat:
          tensorizers["dict_feat"] = GazetteerTensorizer.from_config(
              GazetteerTensorizer.Config(
                  text_column="source_sequence", dict_column="dict_feat"
              )
          )
          initialize_tensorizers(
              {"dict_feat": tensorizers["dict_feat"]}, data_source.train
          )
  
      if add_contextual_feat:
          tensorizers[
              "contextual_token_embedding"
          ] = ByteTokenTensorizer.from_config(
              ByteTokenTensorizer.Config(column="source_sequence")
          )
          initialize_tensorizers(
              {
                  "contextual_token_embedding": tensorizers[
                      "contextual_token_embedding"
                  ]
              },
              data_source.train,
          )
  
      return tensorizers
  
imports: import unittest
  import torch
  from pytext.common.constants import Stage
  from pytext.data import Batcher
  from pytext.data.data import Data
  from pytext.data.sources.data_source import Gazetteer
  from pytext.data.sources.tsv import TSVDataSource
  from pytext.data.tensorizers import ByteTokenTensorizer, GazetteerTensorizer, initialize_tensorizers, TokenTensorizer
  from pytext.models.embeddings import ContextualTokenEmbedding, DictEmbedding, WordEmbedding
  from pytext.models.seq_models.rnn_encoder import LSTMSequenceEncoder
  from pytext.models.seq_models.rnn_encoder_decoder import RNNModel
  from pytext.models.seq_models.seq2seq_model import Seq2SeqModel
  from pytext.utils.test import import_tests_module
label_desc: Use image node_id 1 for calling a global function with example usage: get_tensorizers(add_dict_feat, add_contextual_feat) and returns: tensorizers