code: def wrap(v, cls):
      # wrap inputs if necessary
      if type(v) in {tuple, list}:
          return type(v)(wrap(vi, cls) for vi in v)
  
      return cls(v) if isinstance(v, Tensor) else v
  
imports: import collections
  import torch
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: wrap(v, cls) and returns: unknown, type