code: def read_nemo_manifest(config, is_tarred: bool) -> CutSet:
      common_kwargs = {
          "text_field": config.text_field,
          "lang_field": config.lang_field,
      }
      if is_tarred:
          if isinstance(config.manifest_filepath, (str, Path)):
              logging.info(
                  f"Initializing Lhotse CutSet from a single NeMo manifest (tarred): '{config.manifest_filepath}'"
              )
              cuts = CutSet(
                  LazyNeMoTarredIterator(
                      config.manifest_filepath,
                      tar_paths=config.tarred_audio_filepaths,
                      shuffle_shards=config.shuffle,
                      **common_kwargs,
                  )
              )
          else:
              # Format option 1:
              #   Assume it's [[path1], [path2], ...] (same for tarred_audio_filepaths).
              #   This is the format for multiple NeMo buckets.
              #   Note: we set "weights" here to be proportional to the number of utterances in each data source.
              #         this ensures that we distribute the data from each source uniformly throughout each epoch.
              #         Setting equal weights would exhaust the shorter data sources closer the towards the beginning
              #         of an epoch (or over-sample it in the case of infinite CutSet iteration with .repeat()).
              # Format option 1:
              #   Assume it's [[path1, weight1], [path2, weight2], ...] (while tarred_audio_filepaths remain unchanged).
              #   Note: this option allows to manually set the weights for multiple datasets.
              logging.info(
                  f"Initializing Lhotse CutSet from multiple tarred NeMo manifest sources with a weighted multiplexer. "
                  f"We found the following sources and weights: "
              )
              cutsets = []
              weights = []
              for manifest_info, (tar_path,) in zip(
                  config.manifest_filepath,
                  config.tarred_audio_filepaths,
              ):
                  if len(manifest_info) == 1:
                      (manifest_path,) = manifest_info
                      nemo_iter = LazyNeMoTarredIterator(
                          manifest_path=manifest_path,
                          tar_paths=tar_path,
                          shuffle_shards=config.shuffle,
                          **common_kwargs,
                      )
                      weight = len(nemo_iter)
                  else:
                      assert (
                          isinstance(manifest_info, Sequence)
                          and len(manifest_info) == 2
                          and isinstance(manifest_info[1], (int, float))
                      ), (
                          "Supported inputs types for config.manifest_filepath are: "
                          "str | list[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: '{manifest_info}'"
                      )
                      manifest_path, weight = manifest_info
                      nemo_iter = LazyNeMoTarredIterator(
                          manifest_path=manifest_path,
                          tar_paths=tar_path,
                          shuffle_shards=config.shuffle,
                          **common_kwargs,
                      )
                  logging.info(f"- {manifest_path=} {weight=}")
                  if config.max_open_streams is not None:
                      for subiter in nemo_iter.to_shards():
                          cutsets.append(CutSet(subiter))
                          weights.append(weight)
                  else:
                      cutsets.append(CutSet(nemo_iter))
                      weights.append(weight)
              if config.max_open_streams is not None:
                  cuts = CutSet.infinite_mux(
                      *cutsets,
                      weights=weights,
                      seed="trng",
                      max_open_streams=config.max_open_streams,
                  )
              else:
                  cuts = CutSet.mux(
                      *[cs.repeat() for cs in cutsets],
                      weights=weights,
                      seed="trng",
                  )
      else:
          logging.info(
              f"Initializing Lhotse CutSet from a single NeMo manifest (non-tarred): '{config.manifest_filepath}'"
          )
          cuts = CutSet(
              LazyNeMoIterator(
                  config.manifest_filepath, **common_kwargs
              )
          )
      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 3 for calling a global function with example usage: read_nemo_manifest(config, is_tarred) and returns: cuts