def _find_installed_apps_entry(module_label):
    modules = module_label.split('.')
    # if module_label is 'dashboard.catalogue.forms.widgets', combinations
    # will be ['dashboard.catalogue.forms', 'dashboard.catalogue', 'dashboard']
    combinations = [
        '.'.join(modules[:-count]) for count in range(1, len(modules))]
    for app_name in combinations:
        entry = _get_installed_apps_entry(app_name)
        if entry:
            return entry, app_name
    raise AppNotFoundError(
        "Couldn't find an app to import %s from" % module_label)
Given a module label, finds the best matching INSTALLED_APPS entry.
dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/core/loading.py/_find_installed_apps_entry