def _get_cls(name, use='cl'): if use == 'cl': factory = cl_factory else: factory = wb_factory try: cls = factory(name) except Unknown: try: cls = operation.factory(name) except Unknown: raise Exception("Unknown Module: '{}'".format(name)) return cls
def _get_func(dic): """ :param dic: A key, value dictionary :return: A dictionary with the keys replace with references to functions """ res = {} for fname, val in dic.items(): func = factory(fname) if func is None: func = aafactory(fname) if func is None: raise Exception("Unknown function: '{}'".format(fname)) res[func] = val return res