code: def vocab_to_json(vocab: Vocab, path: str):
      
      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)
docs: Saves vocabulary in human-readable json.
  
      :param vocab: Vocabulary mapping.
      :param path: Output file path.