code: def str_to_array(s):
      """
      Simplistic converter of strings from repr to float NumPy arrays.
  
      If the repr representation has ellipsis in it, then this will fail.
  
      Parameters
      ----------
      s : str
          The repr version of a NumPy array.
  
      Examples
      --------
      >>> s = "array([ 0.3,  inf,  nan])"
      >>> a = str_to_array(s)
  
      """
      import numpy as np
  
      # Need to make sure eval() knows about inf and nan.
      # This also assumes default printoptions for NumPy.
      from numpy import inf, nan
  
      if s.startswith("array"):
          # Remove array( and )
          s = s[6:-1]
  
      if s.startswith("["):
          a = np.array(eval(s), dtype=float)
      else:
          # Assume its a regular float. Force 1D so we can index into it.
          a = np.atleast_1d(float(s))
      return a
  
label_desc: Use image node_id 1 for calling a global function with example usage: str_to_array(s) and returns: a