code: def _validate_shape_value(
      shape: Union[int, Tuple[int, ...], Tuple[None]]
  ):
      """Validate shape-like input and return its tuple representation."""
      if shape is None:
          # `None` is used to mean `any shape is allowed` by the array
          #  validation methods, so raise an error here.
          #  Also, setting `None` as a shape is deprecated by NumPy.
          raise TypeError(
              "`None` is not a valid shape. Use `()` instead."
          )
  
      # Return early for common inputs
      if shape in [(), (-1,), (1,), (3,), (2,), (1, 3), (-1, 3)]:
          return shape
  
      def _is_valid_dim(d):
          return isinstance(d, int) and d >= -1
  
      if _is_valid_dim(shape):
          return (shape,)
      if isinstance(shape, tuple) and all(map(_is_valid_dim, shape)):
          return shape
  
      # Input is not valid at this point. Use checks to raise an
      # appropriate error
      check_is_instance(shape, (int, tuple), name="Shape")
      if isinstance(shape, int):
          shape = (shape,)
      else:
          check_is_iterable_of_some_type(shape, int, name="Shape")
      check_is_greater_than(shape, -1, name="Shape", strict=False)
      raise RuntimeError("This line should not be reachable.")
  
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 23 for calling a global function with example usage: _validate_shape_value(shape) and returns: shape, unknown, shape, shape