code: def _calc_same_pad(i: int, k: int, s: int, d: int):
      return max((-(i // -s) - 1) * s + (k - 1) * d + 1 - i, 0)
  
imports: import collections.abc
  import math
  from functools import partial
  from itertools import repeat
  from typing import Tuple, Optional
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from .config import *
label_desc: Use image node_id 4 for calling a global function with example usage: _calc_same_pad(i, k, s, d) and returns: max