code: def _build_functions_with_pickles(data_cfg, condition_cfg):
      def tuple_to_dict(inp):
          for input in inp:
              out_dict = dict()
              out_dict["images"] = input[0]
  
              # Output from pickle transform is already a dictionary
              out_dict.update(input[1])
  
              out_dict["raw_text"] = input[2]
              yield out_dict
  
      def transform_fn(sample):
          image, encodings, text = (
              sample["jpg"],
              sample["pickle"],
              sample["txt"],
          )
          img_transform = construct_image_augmentations(
              data_cfg.train.get("augmentations"), normalize=True
          )
          pickle_transform = PickleTransform(
              encoding_keys=[condition_cfg.precached_key],
              encoding_lengths=[condition_cfg.token_length],
              out_keys=[condition_cfg.out_key],
          )
          text_transform = identical_transform
          return (
              img_transform(image),
              pickle_transform(encodings),
              text_transform(text),
          )
  
      return tuple_to_dict, transform_fn
  
file_path: NeMo/nemo/collections/multimodal/data/imagen/imagen_dataset.py
imports: import torch
  from nemo.collections.multimodal.data.common.webdataset import WebDatasetCommon
  from nemo.collections.multimodal.data.imagen.augmentations.augmentations import PickleTransform, build_resolution_filter
  from nemo.collections.multimodal.data.imagen.augmentations.corruption import ImagePyramidNoCorruptions
  from nemo.collections.multimodal.data.stable_diffusion.augmentation.augmentations import construct_image_augmentations, identical_transform
  from nemo.core.classes import Dataset
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: _build_functions_with_pickles(data_cfg, condition_cfg) and returns: tuple_to_dict,  transform_fn, img_transform,  pickle_transform,  text_transform