code: def calculate_same_padding(kernel_size, stride, shape):
      padding = tuple(
          max(
              0,
              math.ceil(
                  (
                      (shape[i] - 1) * stride[i]
                      + kernel_size[i]
                      - shape[i]
                  )
                  / 2
              ),
          )
          for i in range(len(kernel_size))
      )
      if all(
          kernel_size[i] / 2 >= padding[i]
          for i in range(len(kernel_size))
      ):
          if is_same_padding(padding, stride, kernel_size, shape):
              return padding
      return [0] * len(shape)
  
file_path: ivy/ivy_tests/test_ivy/test_frontends/test_torch/test_nn/test_functional/test_pooling_functions.py
imports: from hypothesis import strategies
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_frontend_test
  import math
label_desc: Use image node_id 1 for calling a global function with example usage: calculate_same_padding(kernel_size, stride, shape) and returns: unknown, padding