code: def _add_vocab_opts(parser, build_vocab_only=False):
      """Options related to vocabulary and features.
  
      Add all options relate to vocabulary or features to parser.
      """
      group = parser.add_argument_group("Vocab")
      group.add(
          "-src_vocab",
          "--src_vocab",
          required=True,
          help=("Path to save" if build_vocab_only else "Path to")
          + " src (or shared) vocabulary file. "
          "Format: one <word> or <word>\t<count> per line.",
      )
      group.add(
          "-tgt_vocab",
          "--tgt_vocab",
          help=("Path to save" if build_vocab_only else "Path to")
          + " tgt vocabulary file. "
          "Format: one <word> or <word>\t<count> per line.",
      )
      group.add(
          "-share_vocab",
          "--share_vocab",
          action="store_true",
          help="Share source and target vocabulary.",
      )
      group.add(
          "--decoder_start_token",
          "-decoder_start_token",
          type=str,
          default=DefaultTokens.BOS,
          help="Default decoder start token "
          "for most ONMT models it is <s> = BOS "
          "it happens that for some Fairseq model it requires </s> ",
      )
      group.add(
          "--default_specials",
          "-default_specials",
          nargs="+",
          type=str,
          default=[
              DefaultTokens.UNK,
              DefaultTokens.PAD,
              DefaultTokens.BOS,
              DefaultTokens.EOS,
          ],
          help="default specials used for Vocab initialization"
          " UNK, PAD, BOS, EOS will take IDs 0, 1, 2, 3 "
          " typically <unk> <blank> <s> </s> ",
      )
  
      _add_features_opts(parser)
  
      if not build_vocab_only:
          group.add(
              "-src_vocab_size",
              "--src_vocab_size",
              type=int,
              default=32768,
              help="Maximum size of the source vocabulary.",
          )
          group.add(
              "-tgt_vocab_size",
              "--tgt_vocab_size",
              type=int,
              default=32768,
              help="Maximum size of the target vocabulary",
          )
          group.add(
              "-vocab_size_multiple",
              "--vocab_size_multiple",
              type=int,
              default=8,
              help="Make the vocabulary size a multiple of this value.",
          )
  
          group.add(
              "-src_words_min_frequency",
              "--src_words_min_frequency",
              type=int,
              default=0,
              help="Discard source words with lower frequency.",
          )
          group.add(
              "-tgt_words_min_frequency",
              "--tgt_words_min_frequency",
              type=int,
              default=0,
              help="Discard target words with lower frequency.",
          )
  
          # Truncation options, for text corpus
          group = parser.add_argument_group("Pruning")
          group.add(
              "--src_seq_length_trunc",
              "-src_seq_length_trunc",
              type=int,
              default=None,
              help="Truncate source sequence length.",
          )
          group.add(
              "--tgt_seq_length_trunc",
              "-tgt_seq_length_trunc",
              type=int,
              default=None,
              help="Truncate target sequence length.",
          )
  
          group = parser.add_argument_group("Embeddings")
          group.add(
              "-both_embeddings",
              "--both_embeddings",
              help="Path to the embeddings file to use "
              "for both source and target tokens.",
          )
          group.add(
              "-src_embeddings",
              "--src_embeddings",
              help="Path to the embeddings file to use for source tokens.",
          )
          group.add(
              "-tgt_embeddings",
              "--tgt_embeddings",
              help="Path to the embeddings file to use for target tokens.",
          )
          group.add(
              "-embeddings_type",
              "--embeddings_type",
              choices=["GloVe", "word2vec"],
              help="Type of embeddings file.",
          )
  
imports: import configargparse
  from onmt.modules.sru import CheckSRU
  from onmt.transforms import AVAILABLE_TRANSFORMS
  from onmt.constants import ModelTask
  from onmt.modules.position_ffn import ACTIVATION_FUNCTIONS
  from onmt.modules.position_ffn import ActivationFunction
  from onmt.constants import DefaultTokens
label_desc: Use image node_id 6 for calling a global function with example usage: _add_vocab_opts(parser, build_vocab_only) without return types