code: def check_is_scalar(scalar, /, *, name="Scalar"):
      """Check if an object is a real-valued scalar number.
  
      Parameters
      ----------
      scalar : int | float | array_like[int] | array_like[float]
          Real number as an ``int``, ``float``, or 0-dimensional array.
  
      name : str, default: "Scalar"
          Variable name to use in the error messages if any are raised.
  
      Raises
      ------
      TypeError
          If input is not an instance of ``Number`` of a 0-dimensional array.
  
      See Also
      --------
      check_is_number
      check_is_real
  
      Examples
      --------
      Check if an object is scalar.
  
      >>> import numpy as np
      >>> import pyvista.core.input_validation as valid
      >>> valid.check_is_scalar(0.0)
      >>> valid.check_is_scalar(np.array(1))
  
      """
      check_is_instance(scalar, (int, float, np.ndarray), name=name)
      if isinstance(scalar, np.ndarray):
          check_is_real(scalar, name=name)
          if scalar.ndim > 0:
              raise ValueError(
                  f"{name} must be a 0-dimensional array, got `ndim={scalar.ndim}` instead."
              )
  
imports: from collections.abc import Iterable, Sequence
  from numbers import Number
  from typing import Tuple, Union, get_args, get_origin
  import numpy
  from pyvista.core.utilities.arrays import cast_to_ndarray
label_desc: Use image node_id 24 for calling a global function with example usage: check_is_scalar() without return types