code: def get_modules(use_v2):
      # We need a protected import to avoid the V2 warning in case just V1 is used
      if use_v2:
          import torchvision.transforms.v2
          import torchvision.tv_tensors
          import v2_extras
  
          return (
              torchvision.transforms.v2,
              torchvision.tv_tensors,
              v2_extras,
          )
      else:
          import transforms
  
          return transforms, None, None
  
file_path: vision/references/segmentation/presets.py
imports: import torch
label_desc: Use image node_id 1 for calling a global function with example usage: get_modules(use_v2) and returns: torchvision,  torchvision,  v2_extras, transforms,  None,  None