code: def tabbed_parsing_token_generator(
      data_dir,
      tmp_dir,
      train,
      prefix,
      source_vocab_size,
      target_vocab_size,
  ):
      """Generate source and target data from a single file."""
      filename = "parsing_{0}.pairs".format("train" if train else "dev")
      source_vocab = generator_utils.get_or_generate_tabbed_vocab(
          data_dir,
          tmp_dir,
          filename,
          0,
          prefix + "_source.tokens.vocab.%d" % source_vocab_size,
          source_vocab_size,
      )
      target_vocab = generator_utils.get_or_generate_tabbed_vocab(
          data_dir,
          tmp_dir,
          filename,
          1,
          prefix + "_target.tokens.vocab.%d" % target_vocab_size,
          target_vocab_size,
      )
      pair_filepath = os.path.join(tmp_dir, filename)
      return text_problems.text2text_generate_encoded(
          text_problems.text2text_txt_tab_iterator(pair_filepath),
          source_vocab,
          target_vocab,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import registry
label_desc: Use image node_id 1 for calling a global function with example usage: tabbed_parsing_token_generator(data_dir, tmp_dir, train, prefix, source_vocab_size, target_vocab_size) and returns: text_problems