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

# Create a cache as an attribute on the function that way it can cache the
# imported callable rather than re-importing it each time `parse_tags` or
# `edit_string_for_tags` needs the callable.
dataset/ETHPy150Open alex/django-taggit/taggit/utils.py/get_func