def METHOD_NAME(im, resamp=2, fill_val=0):
    """
    Create a resampled image
    Args:
        im (numpy.ndarray):
            The input image. Must be 2-dimensional
        resamp (float):
            Resampling factor. Must be >=1. Defaults to 2
        fill_val (float):
            Replace any non finite values in the image with this value before
            resampling. Defaults to zero.
    Returns:
        numpy.ndarray:
            Resampled image.
    """
    assert resamp >= 1, "resamp must be >= 1"
    if resamp == 1:
        return im
    dims = im.shape
    newdims = [(d - 1) * resamp + 1 for d in dims]
    imc = im.copy()
    imc[~np.isfinite(imc)] = fill_val
    sp = RectBivariateSpline(np.arange(dims[0]), np.arange(dims[0]), imc)
    imresamp = sp(np.arange(newdims[0]) / resamp, np.arange(newdims[1]) / resamp)
    return imresamp