code: def shape_and_axes_validation(shape, axes, input_rank_tensor):
      if shape is not None:
          shape = tf.convert_to_tensor(shape, dtype=tf.dtypes.int32)
          checks_shape = [
              tf.debugging.assert_less_equal(
                  tf.size(shape),
                  input_rank_tensor,
                  message=(
                      "Argument `shape` cannot have length greater than the rank of `x`."
                      f" Received: {shape}"
                  ),
              )
          ]
          with tf.control_dependencies(checks_shape):
              shape = tf.identity(shape)
  
      if axes is not None:
          axes = tf.convert_to_tensor(axes, dtype=tf.dtypes.int32)
          checks_axes = [
              tf.debugging.assert_less_equal(
                  tf.size(axes),
                  input_rank_tensor,
                  message=(
                      "Argument `axes` cannot have length greater than the rank of `x`."
                      f" Received: {axes}"
                  ),
              ),
              tf.debugging.assert_less(
                  axes,
                  input_rank_tensor,
                  message=f"Argument `axes` contains invalid indices. Received: {axes}",
              ),
              tf.debugging.assert_greater_equal(
                  axes,
                  -input_rank_tensor,
                  message=f"Argument `axes` contains invalid indices. Received: {axes}",
              ),
          ]
          with tf.control_dependencies(checks_axes):
              axes = tf.identity(axes)
  
      if shape is not None and axes is not None:
          checks_shape_axes = [
              tf.debugging.assert_equal(
                  tf.size(shape),
                  tf.size(axes),
                  message=(
                      "Arguments `shape` and `axes` must have equal length. Received:"
                      f" {shape}, {axes}"
                  ),
              )
          ]
          with tf.control_dependencies(checks_shape_axes):
              shape, axes = tf.identity_n([shape, axes])
  
      return shape, axes
  
imports: import math
  from typing import Union, Optional, Tuple, List, Literal, Sequence, Callable
  import tensorflow
  from ivy.func_wrapper import inputs_to_ivy_arrays, output_to_native_arrays, with_unsupported_dtypes, with_supported_dtypes, with_supported_device_and_dtypes
  from ..None import backend_version
  import ivy
  from ivy.functional.ivy.layers import _handle_padding, _get_num_padded_values, _validate_max_pool_params, _depth_max_pooling_helper
  from ivy.functional.ivy.experimental.layers import _padding_ceil_mode, _get_size
label_desc: Use image node_id 28 for calling a global function with example usage: shape_and_axes_validation(shape, axes, input_rank_tensor) and returns: shape,  axes