code: def _validate_scalar_shape(ndarray, name):
      if ndarray.ndim != 0:
          raise ValueError(
              "Expected scalar value for %r but got %r"
              % (name, ndarray)
          )
      return ndarray
  
file_path: tensorboard/tensorboard/summary/_writer.py
imports: import time
  import numpy
  from tensorboard.plugins.scalar import metadata
  from tensorboard.summary import _output
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_scalar_shape(ndarray, name) and returns: ndarray