code: def create_label_dictionaries(
      labels_file: Path,
      text_start_bytes: List[int],
      num_lines: int,
      lines_per_dataset_fragment: int,
      pad_label: str,
      n_jobs: int,
  ) -> Tuple[Dict[str, int], Dict[str, int]]:
      """
      Creates punctuation and capitalization label ids dictionaries based on labels present in ``labels_file``.
  
      Args:
          labels_file: a path to file with labels
          text_start_bytes: indices of first bytes of fragments in ``labels_file``
          num_lines: total number of lines in ``labels_file``
          lines_per_dataset_fragment: number of lines in dataset fragments. The last fragment can have fewer lines
          pad_label: a label used for padding and for absence of punctuation and capitalization
          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
      """
      with Progress(
          num_lines, "Creating label dictionary", "line"
      ) as progress_queues:
          result = Parallel(n_jobs=min(n_jobs, len(text_start_bytes)))(
              delayed(collect_unique_labels_from_fragment)(
                  labels_file,
                  start_pos,
                  lines_per_dataset_fragment,
                  *progress_queues,
                  fragment_idx,
              )
              for fragment_idx, start_pos in enumerate(text_start_bytes)
          )
      unique_punct, unique_capit = zip(*result)
      unique_punct = set().union(*unique_punct)
      unique_capit = set().union(*unique_capit)
      return create_label_ids(
          unique_punct, pad_label
      ), create_label_ids(unique_capit, pad_label)
  
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 6 for calling a global function with example usage: create_label_dictionaries(labels_file, text_start_bytes, num_lines, lines_per_dataset_fragment, pad_label, n_jobs) and returns: create_label_ids,  create_label_ids