code: def valid_tuple_axes(
      ndim: int,
      *,
      min_size: int = 0,
      max_size: Optional[int] = None,
  ) -> st.SearchStrategy[Tuple[int, ...]]:
      """All tuples will have a length >= ``min_size`` and <= ``max_size``. The default
      value for ``max_size`` is ``ndim``.
  
      Examples from this strategy shrink towards an empty tuple, which render most
      sequential functions as no-ops.
  
      The following are some examples drawn from this strategy.
  
      .. code-block:: pycon
  
        >>> [valid_tuple_axes(3).example() for i in range(4)]
        [(-3, 1), (0, 1, -1), (0, 2), (0, -2, 2)]
  
      ``valid_tuple_axes`` can be joined with other strategies to generate
      any type of valid axis object, i.e. integers, tuples, and ``None``:
  
      .. code-block:: python
  
        any_axis_strategy = none() | integers(-ndim, ndim - 1) | valid_tuple_axes(ndim)
  
      """
      check_type(int, ndim, "ndim")
      check_type(int, min_size, "min_size")
      if max_size is None:
          max_size = ndim
      check_type(int, max_size, "max_size")
      order_check("size", 0, min_size, max_size)
      check_valid_interval(max_size, ndim, "max_size", "ndim")
  
      axes = st.integers(0, max(0, 2 * ndim - 1)).map(
          lambda x: x if x < ndim else x - 2 * ndim
      )
  
      return st.lists(
          axes,
          min_size=min_size,
          max_size=max_size,
          unique_by=lambda x: x % ndim,
      ).map(tuple)
  
imports: import re
  from typing import NamedTuple, Optional, Tuple, Union
  from hypothesis import assume, strategies
  from hypothesis.errors import InvalidArgument
  from hypothesis.internal.conjecture.utils import _calc_p_continue
  from hypothesis.internal.coverage import check_function
  from hypothesis.internal.validation import check_type, check_valid_interval
  from hypothesis.strategies._internal.utils import defines_strategy
  from hypothesis.utils.conventions import UniqueIdentifier, not_set
label_desc: Use image node_id 5 for calling a global function with example usage: valid_tuple_axes(ndim) and returns: st