code: def create_parser():
      parser = argparse.ArgumentParser(
          formatter_class=argparse.RawDescriptionHelpFormatter,
          description="learn BPE-based word segmentation",
      )
  
      parser.add_argument(
          "--input",
          "-i",
          type=argparse.FileType("r"),
          default=sys.stdin,
          metavar="PATH",
          help="Input text (default: standard input).",
      )
  
      parser.add_argument(
          "--output",
          "-o",
          type=argparse.FileType("w"),
          default=sys.stdout,
          metavar="PATH",
          help="Output file for BPE codes (default: standard output)",
      )
      parser.add_argument(
          "--symbols",
          "-s",
          type=int,
          default=10000,
          help="Create this many new symbols (each representing a character n-gram) (default: %(default)s))",
      )
      parser.add_argument(
          "--min-frequency",
          type=int,
          default=2,
          metavar="FREQ",
          help="Stop if no symbol pair has frequency >= FREQ (default: %(default)s))",
      )
      parser.add_argument(
          "--dict-input",
          action="store_true",
          help="If set, input file is interpreted as a dictionary where each line contains a word-count pair",
      )
      parser.add_argument(
          "--verbose", "-v", action="store_true", help="verbose mode."
      )
  
      return parser
  
file_path: OpenNMT-py/tools/learn_bpe.py
imports: from __future__ import unicode_literals
  import sys
  import codecs
  import re
  import copy
  import argparse
  from collections import defaultdict, Counter
  from io import open
label_desc: Use image node_id 1 for calling a global function with example usage: create_parser() and returns: parser