def webpyfunc(inp, fvars=None, autoreload=False):
 if (not fvars):
  fvars = upvars()
 if (not hasattr(inp, '__call__')):
  if autoreload:
   mod = __import__(fvars['__file__'].split(os.path.sep).pop().split('.')[0])
   name = dictfind(fvars, inp)
   func = (lambda : handle(getattr(mod, name), mod))
  else:
   func = (lambda : handle(inp, fvars))
 else:
  func = inp
 return func

def webpyfunc ( inp , fvars = None , autoreload = False ) : if ( not fvars ) : fvars = upvars ( ) if ( not hasattr ( inp , '__call__' ) ) : if autoreload : mod = __import__ ( fvars [ '__file__' ] . split ( os . path . sep ) . pop ( ) . split ( '.' ) [ 0 ] ) name = dictfind ( fvars , inp ) func = ( lambda : handle ( getattr ( mod , name ) , mod ) ) else : func = ( lambda : handle ( inp , fvars ) ) else : func = inp return func
if inp is a url mapping .