code: def same_padding(
      kernel_size: Sequence[int] | int,
      dilation: Sequence[int] | int = 1,
  ) -> tuple[int, ...] | int:
      """
      Return the padding value needed to ensure a convolution using the given kernel size produces an output of the same
      shape as the input for a stride of 1, otherwise ensure a shape of the input divided by the stride rounded down.
  
      Raises:
          NotImplementedError: When ``np.any((kernel_size - 1) * dilation % 2 == 1)``.
  
      """
  
      kernel_size_np = np.atleast_1d(kernel_size)
      dilation_np = np.atleast_1d(dilation)
  
      if np.any((kernel_size_np - 1) * dilation % 2 == 1):
          raise NotImplementedError(
              f"Same padding not available for kernel_size={kernel_size_np} and dilation={dilation_np}."
          )
  
      padding_np = (kernel_size_np - 1) / 2 * dilation_np
      padding = tuple(int(p) for p in padding_np)
  
      return padding if len(padding) > 1 else padding[0]
  
file_path: MONAI/monai/networks/layers/convutils.py
imports: from __future__ import annotations
  from collections.abc import Sequence
  import numpy
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: same_padding(kernel_size, dilation) and returns: unknown