code: def vocab_to_json(vocab: Vocab, path: str):
      """
      Saves vocabulary in human-readable json.
  
      :param vocab: Vocabulary mapping.
      :param path: Output file path.
      """
      with open(path, "w", encoding=C.VOCAB_ENCODING) as out:
          json.dump(vocab, out, indent=4, ensure_ascii=False)
          logger.info('Vocabulary saved to "%s"', path)
  
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 6 for calling a global function with example usage: vocab_to_json(vocab, path) without return types