def resolve_func(spec):
 try:
  idx = spec.rindex('.')
  mname = spec[:idx]
  fname = spec[(idx + 1):]
  module = _import_module(mname)
  return getattr(module, fname)
 except ValueError:
  return globals()[spec]

def resolve_func ( spec ) : try : idx = spec . rindex ( '.' ) mname = spec [ : idx ] fname = spec [ ( idx + 1 ) : ] module = _import_module ( mname ) return getattr ( module , fname ) except ValueError : return globals ( ) [ spec ]
resolve a function by name given a function specified by module .