code: def read_lhotse_manifest(config, is_tarred: bool) -> CutSet:
      if is_tarred:
          # Lhotse Shar is the equivalent of NeMo's native "tarred" dataset.
          # The combination of shuffle_shards, and repeat causes this to
          # be an infinite manifest that is internally reshuffled on each epoch.
          # The parameter ``config.shard_seed`` is used to determine shard shuffling order. Options:
          # - "trng" means we'll defer setting the seed until the iteration
          #   is triggered, and we'll use system TRNG to get a completely random seed for each worker.
          #   This results in every dataloading worker using full data but in a completely different order.
          # - "randomized" means we'll defer setting the seed until the iteration
          #   is triggered, and we'll use config.seed to get a pseudo-random seed for each worker.
          #   This results in every dataloading worker using full data but in a completely different order.
          #   Unlike "trng", this is deterministic, and if you resume training, you should change the seed
          #   to observe different data examples than in the previous run.
          # - integer means we'll set a specific seed in every worker, and data would be duplicated across them.
          #   This is mostly useful for unit testing or debugging.
          shard_seed = config.shard_seed
          if config.cuts_path is not None:
              warnings.warn(
                  "Note: lhotse.cuts_path will be ignored because lhotse.shar_path was provided."
              )
          if isinstance(config.shar_path, (str, Path)):
              logging.info(
                  f"Initializing Lhotse Shar CutSet (tarred) from a single data source: '{config.shar_path}'"
              )
              cuts = CutSet.from_shar(
                  in_dir=config.shar_path,
                  shuffle_shards=True,
                  seed=shard_seed,
              ).repeat()
          else:
              # Multiple datasets in Lhotse Shar format: we will dynamically multiplex them
              # with probability approximately proportional to their size
              logging.info(
                  "Initializing Lhotse Shar CutSet (tarred) from multiple data sources with a weighted multiplexer. "
                  "We found the following sources and weights: "
              )
              cutsets = []
              weights = []
              for item in config.shar_path:
                  if isinstance(item, (str, Path)):
                      path = item
                      cs = CutSet.from_shar(
                          in_dir=path,
                          shuffle_shards=True,
                          seed=shard_seed,
                      )
                      weight = len(cs)
                  else:
                      assert (
                          isinstance(item, Sequence)
                          and len(item) == 2
                          and isinstance(item[1], (int, float))
                      ), (
                          "Supported inputs types for config.shar_path are: "
                          "str | list[str] | list[tuple[str, number]] "
                          "where str is a path and number is a mixing weight (it may exceed 1.0). "
                          f"We got: '{item}'"
                      )
                      path, weight = item
                      cs = CutSet.from_shar(
                          in_dir=path,
                          shuffle_shards=True,
                          seed=shard_seed,
                      )
                  logging.info(f"- {path=} {weight=}")
                  cutsets.append(cs.repeat())
                  weights.append(weight)
              cuts = CutSet.mux(*cutsets, weights=weights)
      else:
          # Regular Lhotse manifest points to individual audio files (like native NeMo manifest).
          cuts = CutSet.from_file(config.cuts_path)
      return cuts
  
file_path: NeMo/nemo/collections/common/data/lhotse/cutset.py
imports: import logging
  import warnings
  from pathlib import Path
  from typing import Sequence, Tuple
  from lhotse import CutSet
  from nemo.collections.common.data.lhotse.nemo_adapters import LazyNeMoIterator, LazyNeMoTarredIterator
label_desc: Use image node_id 2 for calling a global function with example usage: read_lhotse_manifest(config, is_tarred) and returns: cuts