code: def pretty_str(label, arr):
      """
      Generates a pretty printed NumPy array with an assignment. Optionally
      transposes column vectors so they are drawn on one line. Strictly speaking
      arr can be any time convertible by `str(arr)`, but the output may not
      be what you want if the type of the variable is not a scalar or an
      ndarray.
  
      Examples
      --------
      >>> pprint('cov', np.array([[4., .1], [.1, 5]]))
      cov = [[4.  0.1]
             [0.1 5. ]]
  
      >>> print(pretty_str('x', np.array([[1], [2], [3]])))
      x = [[1 2 3]].T
      """
  
      def is_col(a):
          """return true if a is a column vector"""
          try:
              return a.shape[0] > 1 and a.shape[1] == 1
          except (AttributeError, IndexError):
              return False
  
      # display empty lists correctly
      try:
          if len(arr) == 0:
              return label + " = " + str(type(arr)())
      except TypeError:
          pass
  
      if type(arr) is list or type(arr) is tuple or type(arr) is deque:
          return "\n".join(
              [
                  pretty_str(label + "[" + str(i) + "]", x)
                  for (i, x) in enumerate(arr)
              ]
          )
  
      if label is None:
          label = ""
  
      if label:
          label += " = "
  
      if is_col(arr):
          return label + str(arr.T).replace("\n", "") + ".T"
  
      rows = str(arr).split("\n")
      if not rows:
          return ""
  
      s = label + rows[0]
      pad = " " * len(label)
      for line in rows[1:]:
          s = s + "\n" + pad + line
  
      return s
  
imports: from __future__ import print_function
  from collections import defaultdict, deque
  import copy
  import inspect
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: pretty_str(label, arr) and returns: s, str, unknown, str, unknown, unknown, False