

def get_func(key, default):
    func_path = getattr(settings, key, default)
    try:
        return get_func.cache[func_path]
    except KeyError:
        (mod_path, func_name) = func_path.rsplit('.', 1)
        func = getattr(import_module(mod_path), func_name)
        get_func.cache[func_path] = func
        return func

dataset/ETHPy150Open alex/django-taggit/taggit/utils.py get_func/original