code: def to_list(arr):
      if torch.is_tensor(arr):
          return arr.cpu().numpy().tolist()
      if isinstance(arr, np.ndarray):
          return arr.tolist()
      if isinstance(arr, (list, tuple)):
          return list(arr)
      return arr
  
imports: import logging
  from collections import OrderedDict
  import time
  import numpy
  import torch
  import nni.retiarii.nn.pytorch
  from nni.nas.pytorch.mutables import Mutable, InputChoice, LayerChoice
label_desc: Use image node_id 6 for calling a global function with example usage: to_list(arr) and returns: arr, arr, arr, list