code: def to_np(array, dtype=np.float32):
      if "scipy.sparse" in str(type(array)):
          array = array.todense()
      return np.array(array, dtype=dtype)
  
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  import os.path
  import pickle
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling a global function with example usage: to_np(array, dtype) and returns: np