code: def prepare_TFRecord_data(
      processor, tokenizer, data_dir, max_seq_length, output_dir
  ):
      """
      Args:
          processor: Data Preprocessor, which must have get_lables,
              get_train/dev/test/examples methods defined.
          tokenizer: The Sentence Tokenizer. Generally should be
              SentencePiece Model.
          data_dir: The input data directory.
          max_seq_length: Max sequence length.
          output_dir: The directory to save the TFRecord in.
      """
      label_list = processor.get_labels()
  
      train_examples = processor.get_train_examples(data_dir)
      train_file = os.path.join(output_dir, "train.tf_record")
      convert_examples_to_features_and_output_to_files(
          train_examples,
          label_list,
          max_seq_length,
          tokenizer,
          train_file,
      )
  
      eval_examples = processor.get_dev_examples(data_dir)
      eval_file = os.path.join(output_dir, "eval.tf_record")
      convert_examples_to_features_and_output_to_files(
          eval_examples,
          label_list,
          max_seq_length,
          tokenizer,
          eval_file,
      )
  
      test_examples = processor.get_test_examples(data_dir)
      test_file = os.path.join(output_dir, "predict.tf_record")
      convert_examples_to_features_and_output_to_files(
          test_examples,
          label_list,
          max_seq_length,
          tokenizer,
          test_file,
      )
  
imports: import os
  import csv
  import collections
  import tensorflow
  import texar.tf
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_TFRecord_data(processor, tokenizer, data_dir, max_seq_length, output_dir) without return types