def METHOD_NAME(
    spatial_dimensions: int,
    pad_np: np.array,
    dim_coord: Tuple[int],
    kernel: Tuple[int],
    strides: Tuple[int],
    dilation: Tuple[int],
) -> Tuple[slice]:
    """
    Programmatically create a slice object of the right dimensions for pad_np.
    We assume pad_np's first two dimensions are not spatial and are not touched by the pad.
    pad_np[slice] should give the elements of the data that a pool operation will use for the
    step given in dim_coord.
    """
    slices = [slice(None)] * spatial_dimensions
    for nd in range(spatial_dimensions):
        slices[nd] = slice(
            dim_coord[nd] * strides[nd],
            dim_coord[nd] * strides[nd] + (kernel[nd] - 1) * dilation[nd] + 1,
            dilation[nd],
        )
    # Add back batch and channel dimensions
    slices = [slice(None), slice(None)] + slices
    return tuple(slices)