code: def is_scalar(value):
      
      return np.isscalar(value) or (isinstance(value, np.ndarray) and (len(np.squeeze(value).shape) == 0))
docs: Test if the given value is a scalar.
  
      This function also works with memory mapped array values, in contrast to the numpy is_scalar method.
  
      Args:
          value: the value to test for being a scalar value
  
      Returns:
          boolean: if the given value is a scalar or not