code: def conversion_helper(val, conversion):
      """Apply conversion to val. Recursively apply conversion if `val` is a nested tuple/list structure."""
      if not isinstance(val, (tuple, list)):
          return conversion(val)
      rtn = [conversion_helper(v, conversion) for v in val]
      if isinstance(val, tuple):
          rtn = tuple(rtn)
      return rtn
  
imports: import torch
  from torch import nn
  from torch.autograd import Variable
  from torch.nn.parameter import Parameter
  from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
  from common.loss_scaler import DynamicLossScaler, LossScaler
label_desc: Use image node_id 1 for calling a global function with example usage: conversion_helper(val, conversion) and returns: rtn, conversion