code: def build_from_paths(
      paths: Iterable[str],
      num_words: Optional[int] = None,
      min_count: int = 1,
      pad_to_multiple_of: Optional[int] = None,
      mapper: Callable = map,
  ) -> Vocab:
      """
      Creates a vocabulary mapping from words to ids from shard paths to files in sentence-per-line format.
      A sentence is just a whitespace delimited list of tokens. Note that special symbols like the beginning of sentence (BOS)
      symbol will be added to the vocabulary.
  
      :param paths: List of tuples containing shard paths to files with one sentence per line.
      :param num_words: Optional maximum number of words in the vocabulary.
      :param min_count: Minimum occurrences of words to be included in the vocabulary.
      :param pad_to_multiple_of: If not None, pads the vocabulary to a size that is the next multiple of this int.
      :param mapper: Built-in map function for sequential execution or multiprocessing.pool.map function for parallel execution.
      :return: Word-to-id mapping.
      """
      logger.info("Building vocabulary from dataset(s): %s", " ".join(paths))  # type: ignore
      vocab_counters = mapper(count_tokens_for_path, paths)
      # Combine shard Counters and create a single Vocab
      raw_vocab = sum(vocab_counters, Counter())  # type: Counter
      return build_pruned_vocab(
          raw_vocab=raw_vocab,
          num_words=num_words,
          min_count=min_count,
          pad_to_multiple_of=pad_to_multiple_of,
      )
  
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 2 for calling a global function with example usage: build_from_paths(paths, num_words, min_count, pad_to_multiple_of, mapper) and returns: build_pruned_vocab