code: def test_check_is_sorted(shape, axis, ascending, strict):
      def _check_is_sorted_params(arr):
          check_is_sorted(
              arr, axis=axis, strict=strict, ascending=ascending
          )
  
      if shape == ():
          # test always succeeds with scalar
          _check_is_sorted_params(0)
          return
  
      # Create ascending array with unique values
      num_elements = np.prod(shape)
      arr_strict_ascending = np.arange(num_elements).reshape(shape)
  
      try:
          # Create ascending array with duplicate values
          arr_ascending = np.repeat(arr_strict_ascending, 2, axis=axis)
          # Create descending arrays
          arr_descending = np.flip(arr_ascending, axis=axis)
          arr_strict_descending = np.flip(
              arr_strict_ascending, axis=axis
          )
      except np.AxisError:
          # test ValueError is raised whenever an AxisError would otherwise be raised
          with pytest.raises(
              ValueError,
              match=f"Axis {axis} is out of bounds for ndim {arr_strict_ascending.ndim}",
          ):
              _check_is_sorted_params(arr_strict_ascending)
          return
  
      if axis is None and arr_ascending.ndim > 1:
          # test that axis=None will flatten array and cause it not to be sorted for higher dimension arrays
          with pytest.raises(ValueError):
              _check_is_sorted_params(arr_ascending)
          return
  
      if strict and ascending:
          _check_is_sorted_params(arr_strict_ascending)
          for a in [
              arr_ascending,
              arr_descending,
              arr_strict_descending,
          ]:
              with pytest.raises(
                  ValueError,
                  match="must be sorted in strict ascending order",
              ):
                  _check_is_sorted_params(a)
  
      elif not strict and ascending:
          _check_is_sorted_params(arr_ascending)
          _check_is_sorted_params(arr_strict_ascending)
          for a in [arr_descending, arr_strict_descending]:
              with pytest.raises(
                  ValueError, match="must be sorted in ascending order"
              ):
                  _check_is_sorted_params(a)
  
      elif strict and not ascending:
          _check_is_sorted_params(arr_strict_descending)
          for a in [
              arr_ascending,
              arr_strict_ascending,
              arr_descending,
          ]:
              with pytest.raises(
                  ValueError,
                  match="must be sorted in strict descending order",
              ):
                  _check_is_sorted_params(a)
  
      elif not strict and not ascending:
          _check_is_sorted_params(arr_descending)
          _check_is_sorted_params(arr_strict_descending)
          for a in [arr_ascending, arr_strict_ascending]:
              with pytest.raises(
                  ValueError, match="must be sorted in descending order"
              ):
                  _check_is_sorted_params(a)
  
imports: from collections import namedtuple
  from re import escape
  import sys
  from typing import Union, get_args, get_origin
  import numpy
  import pytest
  from vtk import vtkTransform
  from pyvista.core import pyvista_ndarray
  from pyvista.core.input_validation.check import _validate_shape_value, check_has_length, check_has_shape, check_is_arraylike, check_is_dtypelike, check_is_finite, check_is_greater_than, check_is_in_range, check_is_instance, check_is_integerlike, check_is_iterable, check_is_iterable_of_some_type, check_is_iterable_of_strings, check_is_less_than, check_is_nonnegative, check_is_number, check_is_real, check_is_scalar, check_is_sequence, check_is_sorted, check_is_string, check_is_string_in_iterable, check_is_subdtype, check_is_type
  from pyvista.core.input_validation.validate import _set_default_kwarg_mandatory, validate_array, validate_array3, validate_arrayN, validate_arrayN_uintlike, validate_arrayNx3, validate_axes, validate_data_range, validate_dtype, validate_number, validate_transform3x3, validate_transform4x4
  from pyvista.core.utilities.arrays import cast_to_tuple_array, vtkmatrix_from_array
label_desc: Use image node_id 35 for calling a global function with example usage: test_check_is_sorted(shape, axis, ascending, strict) without return types