code: def tensor_wrap(*args, **kwargs):
      tensor_list, tensor_map = [], {}
      for arg in args:
          wrapped_arg = (
              torch.tensor(arg) if isinstance(arg, list) else arg
          )
          tensor_list.append(wrapped_arg)
      for k in kwargs:
          kwarg = kwargs[k]
          wrapped_kwarg = (
              torch.tensor(kwarg) if isinstance(kwarg, list) else kwarg
          )
          tensor_map[k] = wrapped_kwarg
      if args and not kwargs:
          return tensor_list
      if kwargs and not args:
          return tensor_map
      return tensor_list, tensor_map
  
imports: import math
  import numpy
  import torch
  from torch.distributions.utils import logits_to_probs
  from pyro.distributions.util import broadcast_shape
label_desc: Use image node_id 1 for calling a global function with example usage: tensor_wrap() and returns: tensor_list,  tensor_map, tensor_list, tensor_map