code: def asnumpy(x, device):
      if x is None:
          return None
      if isinstance(x, list):
          return [asnumpy(y, device) for y in x]
      if isinstance(x, np.ndarray):
          return x
      if device == "cpu":
          return from_dlpack(x).numpy()
      else:
          return from_dlpack(x).cpu().numpy()
  
file_path: DALI/dali/test/python/test_external_source_pytorch_dlpack.py
imports: import numpy
  import nvidia.dali.fn
  import nvidia.dali.ops
  import torch
  from nvidia.dali.backend_impl import *
  from nvidia.dali import Pipeline
  from torch.utils.dlpack import to_dlpack, from_dlpack
  from test_utils import check_output
label_desc: Use image node_id 1 for calling a global function with example usage: asnumpy(x, device) and returns: None, unknown, x, from_dlpack, from_dlpack