code: def vmobj_to_list(o, dtype="float32"):
      if isinstance(o, tvm.nd.NDArray):
          return [o.numpy().tolist()]
      elif isinstance(o, tvm.runtime.container.ADT):
          if len(o) == 0:
              tensor_nil = p.get_var("tensor_nil", dtype=dtype)
              if tensor_nil.tag == o.tag:
                  return [0]
              return []
  
          result = []
          for f in o:
              result.extend(vmobj_to_list(f, dtype))
          return result
      elif isinstance(
          o, tvm.relay.backend.interpreter.ConstructorValue
      ):
          if o.constructor.name_hint == "Cons":
              tl = vmobj_to_list(o.fields[1], dtype)
              hd = vmobj_to_list(o.fields[0], dtype)
              hd.extend(tl)
              return hd
          elif o.constructor.name_hint == "Nil":
              return []
          elif "tensor_nil" in o.constructor.name_hint:
              return [0]
          elif "tensor" in o.constructor.name_hint:
              return [o.fields[0].numpy()]
          else:
              raise RuntimeError(
                  "Unknown object type: %s" % o.constructor.name_hint
              )
      else:
          raise RuntimeError("Unknown object type: %s" % type(o))
  
imports: import pytest
  import tvm
  from tvm import relay
  from tvm.relay import testing
  from tvm.relay.backend.interpreter import ConstructorValue
  from tvm.relay import create_executor
  from tvm.relay.prelude import Prelude, StaticTensorArrayOps
  from tvm.relay.testing import count, make_nat_value, make_nat_expr
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: vmobj_to_list(o, dtype) and returns: list, result, list, list, hd, list, list, list