code: def get_label_dictionaries(
      labels_file: Path,
      start_bytes: List[int],
      num_lines: int,
      lines_per_dataset_fragment: int,
      pad_label: str,
      punct_label_ids: Optional[Dict[str, int]],
      capit_label_ids: Optional[Dict[str, int]],
      punct_label_vocab_file: Optional[Path],
      capit_label_vocab_file: Optional[Path],
      n_jobs: int,
  ) -> Tuple[Dict[str, int], Dict[str, int]]:
      """
      Return label ids if the label ids are present in parameters ``punct_label_ids``, ``capit_label_ids``,
      ``punct_label_vocab_file``, ``capit_label_vocab_file``. Otherwise, label ids are created using ``labels_file``.
  
      Args:
          labels_file: a path to file with labels. Labels have to be given in the format described in
              https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/nlp/punctuation_and_capitalization.html#nemo-data-format
          start_bytes: a list of positions in ``labels_file`` at which fragments start. Parameter ``start_bytes`` is used
              for creating labels for several fragments in parallel
          num_lines: total number of lines in ``labels_file``. Parameter ``num_lines`` is used for showing progress of
              label ids collection
          lines_per_dataset_fragment: number of lines in a dataset fragment
          pad_label: a label used for padding and also neutral label showing there is no punctuation and capitalization.
              Label ``pad_label`` has to have id ``0`` in parameters ``punct_label_ids``, ``capit_label_ids``,
              ``punct_label_vocab_file``, ``capit_label_vocab_file`` if these parameters are provided.
          punct_label_ids: a dictionary with punctuation label ids. Pad label has to have id ``0``. No more than 1 of
              parameters ``punct_label_ids`` and ``punct_label_vocab_file`` can be provided.
          capit_label_ids: a dictionary with capitalization label ids. Pad label has to have id ``0``. No more than 1 of
              parameters ``capit_label_ids`` and ``capit_label_vocab_file`` can be provided.
          punct_label_vocab_file: a text file with punctuation labels. Every line in the file contains 1 label. Pad label
              has to be in the first line. No more than 1 of parameters ``punct_label_ids`` and
              ``punct_label_vocab_file`` can be provided.
          capit_label_vocab_file: a text file with capitalization labels. Every line in the file contains 1 label. Pad
              label has to be in the first line. No more than 1 of parameters ``capit_label_ids`` and
              ``capit_label_vocab_file`` can be provided.
          n_jobs: a number of fragments processed in parallel
  
      Returns:
          punct_label_ids: a dictionary with punctuation label ids
          capit_label_ids: a dictionary with capitalization label ids
      """
      if (
          punct_label_ids is not None
          and punct_label_vocab_file is not None
      ):
          raise ValueError(
              "You can provide at most one of parameters `punct_label_ids` and `punct_label_vocab_file`."
          )
      if (
          capit_label_ids is not None
          and capit_label_vocab_file is not None
      ):
          raise ValueError(
              "You can provide at most one of parameters `capit_label_ids` and `capit_label_vocab_file`."
          )
      if punct_label_ids is None and punct_label_vocab_file is not None:
          punct_label_ids = load_label_ids(punct_label_vocab_file)
      if capit_label_ids is None and capit_label_vocab_file is not None:
          capit_label_ids = load_label_ids(capit_label_vocab_file)
      check_label_ids(pad_label, punct_label_ids, capit_label_ids)
      if punct_label_ids is None or capit_label_ids is None:
          (
              _punct_label_ids,
              _capit_label_ids,
          ) = create_label_dictionaries(
              labels_file,
              start_bytes,
              num_lines,
              lines_per_dataset_fragment,
              pad_label,
              n_jobs,
          )
          if punct_label_ids is None:
              punct_label_ids = _punct_label_ids
          if capit_label_ids is None:
              capit_label_ids = _capit_label_ids
      return punct_label_ids, capit_label_ids
  
imports: import inspect
  import json
  import multiprocessing
  import os
  import pickle
  import re
  import shutil
  import tempfile
  from collections import deque
  from pathlib import Path
  from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Type, Union
  import numpy
  import torch
  import webdataset
  from joblib import Parallel, delayed
  from omegaconf import DictConfig
  from torch.utils.data import IterableDataset
  from nemo.collections.common.tokenizers import TokenizerSpec
  from nemo.collections.nlp.data.token_classification.punctuation_capitalization_dataset import LABEL_ID_DIR_FOR_NEMO_CHECKPOINT, BertPunctuationCapitalizationDataset, Progress, create_label_ids, create_masks_and_segment_ids, load_label_ids, raise_not_equal_labels_error
  from nemo.collections.nlp.modules.common.tokenizer_utils import get_tokenizer
  from nemo.core.neural_types import AudioSignal, ChannelType, LabelsType, LengthsType, MaskType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 11 for calling a global function with example usage: get_label_dictionaries(labels_file, start_bytes, num_lines, lines_per_dataset_fragment, pad_label, punct_label_ids, capit_label_ids, punct_label_vocab_file, capit_label_vocab_file, n_jobs) and returns: punct_label_ids,  capit_label_ids