@object_hook_trusted.register('callable')
def numpy_pandas_function_from_str(f):
 if f.startswith(np.__name__):
  mod = np
 elif f.startswith(pd.__name__):
  mod = pd
 elif f.startswith(builtins.__name__):
  mod = builtins
 else:
  msg = 'Function {} not recognized; only numpy, pandas, or builtin functions are supported.'
  raise wz_ex.NotImplemented(msg.format(f))
 fcn = reduce(getattr, f.split('.')[1:], mod)
 return fcn

@ object_hook_trusted . register ( 'callable' ) def numpy_pandas_function_from_str ( f ) : if f . startswith ( np . __name__ ) : mod = np elif f . startswith ( pd . __name__ ) : mod = pd elif f . startswith ( builtins . __name__ ) : mod = builtins else : msg = 'Function {} not recognized; only numpy, pandas, or builtin functions are supported.' raise wz_ex . NotImplemented ( msg . format ( f ) ) fcn = reduce ( getattr , f . split ( '.' ) [ 1 : ] , mod ) return fcn
reconstruct function from string representation .