Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@boost
def func3(c: const(A1)):
return c[0] + 1
@boost
def test_sp_special(v: int, x: float):
return jv(v, x)
@boost
def test_np_fft(u: "float[]"):
u_fft = rfft(u)
return u_fft
@boost
def method2(self, b : int):
return self.a + b
@boost
@boost(wraparound=False, boundscheck=False, cdivision=True, nonecheck=False)
def _erode(
image: A,
selem: A,
out: Optional[A] = None,
shift_x: np.int8 = 0,
shift_y: np.int8 = 0,
):
"""Return greyscale morphological erosion of an image.
Morphological erosion sets a pixel at (i,j) to the minimum over all pixels
in the neighborhood centered at (i,j). Erosion shrinks bright regions and
enlarges dark regions.
Parameters
----------
image : ndarray
@boost
def func(a: float, b: float):
return (a * np.log(b)).max()
@boost(inline=True)
def add(a: T, b: T) -> T:
return a + b
@boost
def unwrap_1d(image: A, unwrapped_image: A):
"""Phase unwrapping using the naive approach."""
unwrapped_image[0] = image[0]
periods = 0
for i in range(1, image.shape[0]):
difference = image[i] - image[i - 1]
if difference > pi:
periods -= 1
elif difference < -pi:
periods += 1
unwrapped_image[i] = image[i] + 2 * pi * periods
@boost
def func(a: A):
i: int
n: int = a.shape[0]
for i in range(n):
a[i] = a[i] + 1.
@boost(boundscheck=False, wraparound=False, cdivision=True, nonecheck=False)
def py_hsv_2_rgb(H: float, S: float, V: float):
"""Convert an HSV value to RGB.
Automatic clipping.
Parameters
----------
H : float
From 0. - 360.
S : float
From 0. - 1.
V : float
From 0. - 1.
Returns
-------