Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@types( int )
def fibonacci( n ):
x = 0
y = 1
for i in range( n ): # pylint: disable=unused-variable
z = x+y
x = y
y = z
return x
@types('int')
def create_full_val(val):
from numpy import full
a = full(3,val)
return a[0],a[1],a[2]
@types('int')
@types('real')
def sqrt_return_type_real(x):
from numpy import sqrt
a = sqrt(x)
return a
@types('complex')
@types( int )
def double_loop( n ):
x = 0
for i in range( 3, 10 ): # pylint: disable=unused-variable
x += 1
y = n*x
for j in range( 4, 15 ): # pylint: disable=unused-variable
z = x-y
return z
@types( 'real[:,:]', 'real' )
def array_real_2d_C_scalar_mul( x, a ):
x[:,:] *= a
@types('real [:]','int')
def f5(x, m1 = 2):
x[:] = 0.
for i in range(0, m1):
x[i] = i * 1.
@types('real')
def floor_call(x):
from numpy import floor
return floor(x)
@types('bool')
def eq_false(a):
c = False
if a == False:
c = True
return c
@types('bool')
def eq_true(a):
c = False
if a == True:
c = True
return c
@types('real [:]')
def g(x):
x[1] = 4.