code: def var_label(var, precision=3):
      """Return label of variable node."""
      if var.name is not None:
          return var.name
      elif isinstance(var, Constant):
          h = np.asarray(var.data)
          is_const = False
          if h.ndim == 0:
              is_const = True
              h = np.array([h])
          dstr = np.array2string(h, precision=precision)
          if "\n" in dstr:
              dstr = dstr[: dstr.index("\n")]
          if is_const:
              dstr = dstr.replace("[", "").replace("]", "")
          return dstr
      else:
          return type_to_str(var.type)
  
imports: import os
  from functools import reduce
  import numpy
  import pytensor
  from pytensor.compile import Function, builders
  from pytensor.graph.basic import Apply, Constant, Variable, graph_inputs
  from pytensor.graph.fg import FunctionGraph
  from pytensor.printing import pydot_imported, pydot_imported_msg
label_desc: Use image node_id 1 for calling a global function with example usage: var_label(var, precision) and returns: var, dstr, type_to_str