code: def unbatch(x):
      if isinstance(x, tf.Tensor):  # TF tensor to NumPy array
          x = x.numpy()
      if x.shape == (1,):  # Singleton array to Python value
          return x.item()
      else:
          return np.squeeze(x, axis=0)
  
imports: import numpy
  import tensorflow
  from tensorforce import Environment, Runner
label_desc: Use image node_id 3 for calling a global function with example usage: unbatch(x) and returns: x, np