code: def _handle_manual_pad_avg_pool(
      x, kernel, strides, padding, ceil_mode, dims
  ):
      if isinstance(padding, str):
          pad_specific = [
              _handle_padding(
                  x.shape[i + 1], strides[i], kernel[i], padding
              )
              for i in range(dims)
          ]
          padding = [
              (
                  pad_specific[i] // 2,
                  pad_specific[i] - pad_specific[i] // 2,
              )
              for i in range(dims)
          ]
      else:
          if isinstance(padding, int):
              padding = [(padding,) * 2] * dims
          pad_specific = [sum(padding[i]) for i in range(dims)]
      c = []
      if ceil_mode:
          for i in range(dims):
              padding[i], c_i = _padding_ceil_mode(
                  x.shape[i + 1],
                  kernel[i],
                  padding[i],
                  strides[i],
                  True,
              )
              c.append(c_i)
              pad_specific[i] = sum(padding[i])
      return padding, pad_specific, c
  
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 5 for calling a global function with example usage: _handle_manual_pad_avg_pool(x, kernel, strides, padding, ceil_mode, dims) and returns: padding,  pad_specific,  c