code: def prepare_vocab(args: argparse.Namespace):
      num_words, num_words_other = args.num_words
      num_words = num_words if num_words > 0 else None
      num_words_other = num_words_other if num_words_other > 0 else None
      utils.check_condition(
          num_words == num_words_other,
          "Vocabulary CLI only allows a common value for --num-words",
      )
      word_min_count, word_min_count_other = args.word_min_count
      utils.check_condition(
          word_min_count == word_min_count_other,
          "Vocabulary CLI only allows a common value for --word-min-count",
      )
  
      setup_main_logger(
          file_logging=not args.no_logfile,
          console=not args.quiet,
          path="%s.%s" % (args.output, C.LOG_NAME),
      )
  
      with utils.create_pool(args.max_processes) as pool:
          vocab = build_from_paths(
              args.inputs,
              num_words=num_words,
              min_count=word_min_count,
              pad_to_multiple_of=args.pad_vocab_to_multiple_of,
              mapper=pool.map,
          )
          logger.info("Vocabulary size: %d ", len(vocab))
          vocab_to_json(vocab, args.output)
  
imports: import argparse
  import json
  import logging
  import os
  from collections import Counter
  from itertools import chain, islice
  from typing import Dict, Iterable, List, Optional, Tuple, Callable
  from sockeye.log import setup_main_logger
  from .None import constants
  from .None import utils
label_desc: Use image node_id 21 for calling a global function with example usage: prepare_vocab(args) without return types