code: def _depth_max_pooling_helper(
      x_shape, kernel, strides, dims, data_format="channel_last"
  ):
      # Determine depth pooling.
      # We assume that the kernel and the data have the same data_format.
      depth_pooling = False
      CHANNEL_LAST = "channel_last"
      channel_idx = -1 if data_format == CHANNEL_LAST else 1
      if len(kernel) == dims + 2:
          spatial_kernel = (
              kernel[1:-1]
              if data_format == CHANNEL_LAST
              else kernel[2:]
          )
          if kernel[channel_idx] != 1:
              depth_pooling = True
              if any(i != 1 for i in spatial_kernel):
                  raise NotImplementedError(
                      "MaxPooling supports exactly one of pooling across"
                      " depth or pooling across width/height."
                  )
              if (
                  len(strides) != dims + 2
                  or strides[channel_idx] != kernel[channel_idx]
              ):
                  raise NotImplementedError(
                      "Depthwise max pooling requires the depth window to equal the depth"
                      " stride"
                  )
              if x_shape[channel_idx] % kernel[channel_idx] != 0:
                  raise NotImplementedError(
                      "Depthwise max pooling requires the depth window to evenly divide"
                      " the input depth"
                  )
              kernel = [kernel[channel_idx], *[1] * (dims - 1)]
              strides = [strides[channel_idx], *[1] * (dims - 1)]
          else:
              kernel = spatial_kernel
              if len(strides) == dims + 2:
                  strides = (
                      strides[1:-1]
                      if data_format == CHANNEL_LAST
                      else strides[2:]
                  )
      return kernel, strides, depth_pooling
  
imports: from typing import Optional, Tuple, Union, Sequence
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, handle_partial_mixed_function, inputs_to_ivy_arrays, to_native_arrays_and_back, inputs_to_native_shapes, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 21 for calling a global function with example usage: _depth_max_pooling_helper(x_shape, kernel, strides, dims, data_format) and returns: kernel,  strides,  depth_pooling