code: def main(_):
      # Read in wordcount file.
      with open(FLAGS.input_path) as wordcount_file:
          word_counts = [
              (line.split()[0], int(line.split()[1]))
              for line in wordcount_file
          ]
  
      # Add in padding tokens.
      reserved_tokens = FLAGS.reserved_tokens
      if FLAGS.num_pad_tokens:
          padded_tokens = ["<pad>"]
          padded_tokens += [
              "<pad%d>" % i for i in range(1, FLAGS.num_pad_tokens)
          ]
          reserved_tokens = padded_tokens + reserved_tokens
  
      vocab = learner.learn(
          word_counts,
          vocab_size=FLAGS.vocab_size,
          reserved_tokens=reserved_tokens,
          upper_thresh=FLAGS.upper_thresh,
          lower_thresh=FLAGS.lower_thresh,
          num_iterations=FLAGS.num_iterations,
          max_input_tokens=FLAGS.max_input_tokens,
          max_token_length=FLAGS.max_token_length,
          max_unique_chars=FLAGS.max_unique_chars,
          slack_ratio=FLAGS.slack_ratio,
          include_joiner_token=FLAGS.include_joiner_token,
          joiner=FLAGS.joiner,
      )
      vocab = "".join([line + "\n" for line in vocab])
  
      # Write vocab to file.
      with open(FLAGS.output_path, "w") as vocab_file:
          vocab_file.write(vocab)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import app
  from absl import flags
  from tensorflow_text.tools.wordpiece_vocab import wordpiece_tokenizer_learner_lib
label_desc: Use image node_id 1 for calling a global function with example usage: main(_) without return types