code: def convert_to_modules(transforms: Optional[Dict[str, Callable]]):
      if transforms is None or isinstance(transforms, nn.Module):
          return transforms
  
      transforms = apply_to_collection(
          transforms, Callable, FuncModule, wrong_dtype=nn.Module
      )
      transforms = apply_to_collection(
          transforms, Mapping, nn.ModuleDict, wrong_dtype=nn.ModuleDict
      )
      return apply_to_collection(
          transforms,
          Iterable,
          nn.ModuleList,
          wrong_dtype=(nn.ModuleList, nn.ModuleDict),
      )
  
file_path: lightning-flash/src/flash/core/data/utils.py
imports: import os.path
  import tarfile
  import zipfile
  from typing import Any, Callable, Dict, Iterable, Mapping, Optional, Set
  import requests
  import urllib3
  from pytorch_lightning.utilities.apply_func import apply_to_collection
  from torch import nn
  from tqdm.auto import tqdm
  from flash.core.utilities.imports import _TOPIC_CORE_AVAILABLE
  from flash.core.utilities.stages import RunningStage
label_desc: Use image node_id 2 for calling a global function with example usage: convert_to_modules(transforms) and returns: apply_to_collection, transforms