def make_singlethread(inner_func):
 def func(*args):
  length = len(args[0])
  result = np.empty(length, dtype=np.float64)
  inner_func(result, *args)
  return result
 return func

def make_singlethread ( inner_func ) : def func ( * args ) : length = len ( args [ 0 ] ) result = np . empty ( length , dtype = np . float64 ) inner_func ( result , * args ) return result return func
run the given function inside a single thread .