Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
break
N = pnts_obj.shape[0]
D = pnts_obj.shape[1]
dtype = pnts_obj.atom.dtype
if dtype not in [np.dtype('u1'), np.dtype('f4'), np.dtype('f8')]:
raise TypeError, 'Datatype %s not supported' % dtype
if dtype == np.dtype('u1'):
dtype = np.dtype('f4')
if approx:
nn_builder = nn_obj_approx_builder(dtype, ntrees, nchecks)
else:
nn_builder = nn_obj_exact_builder(dtype)
pnt_loader = hdf5_wrap(pnts_obj, dtype)
# Callbacks
LOAD_ROWS_FUNC = \
ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_uint, ctypes.c_uint,
ctypes.c_void_p)
NN_BUILDER_FUNC = \
ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p,
ctypes.c_uint, ctypes.c_uint)
load_rows_func = LOAD_ROWS_FUNC(pnt_loader.read_rows)
nn_builder_func = NN_BUILDER_FUNC(nn_builder.build_nn_obj)
# Space for the clusters