code: def isscalar(val):
      """Returns whether `val` is a scalar value or scalar Tensor."""
      if isinstance(val, (np.ndarray, arrays.ndarray, tf.Tensor)):
          return (
              len(val.shape) == 0
          )  # pylint: disable=g-explicit-length-test
      return np.isscalar(val)
  
imports: import funcsigs
  import numpy
  import tensorflow.compat.v2
  from trax.tf_numpy.numpy_impl import arrays
  from trax.tf_numpy.numpy_impl import dtypes
label_desc: Use image node_id 6 for calling a global function with example usage: isscalar(val) and returns: np, unknown