code: def validate_numpy_array(value: Any):
      r"""
      Validates the input and makes sure it returns a numpy array (i.e on CPU)
  
      Args:
          value (Any): the input value
  
      Raises:
          TypeError: if the value is not a numpy array or torch tensor
  
      Returns:
          np.ndarray: numpy array of the value
      """
      if isinstance(value, np.ndarray):
          pass
      elif isinstance(value, list):
          value = np.array(value)
      elif torch.is_tensor(value):
          value = value.cpu().numpy()
      else:
          raise TypeError(
              "Value must be a numpy array, a torch tensor or a list"
          )
  
      return value
  
imports: from typing import Any
  import matplotlib.pyplot
  import numpy
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: validate_numpy_array(value) and returns: value