def _get_all_widgets(request):
    "Retrieve widgets from all available modules"

    user = request.user.profile
    perspective = user.get_perspective()
    modules = perspective.get_modules()

    widgets = {}

    # For each Module in the Perspective get widgets
    for module in modules:
        try:
            import_name = module.name + ".widgets"
            module_widget_lib = __import__(
                import_name, fromlist=[str(module.name)])
            module_widgets = module_widget_lib.get_widgets(request)

            # Preprocess widget, ensure it has all required fields
            for name in module_widgets:
                if 'module_name' not in module_widgets[name]:
                    module_widgets[name]['module_name'] = module.name
                if 'module_title' not in module_widgets[name]:
                    module_widgets[name]['module_title'] = module.title
                module_widgets[name] = _preprocess_widget(
                    module_widgets[name], name)

            widgets.update(module_widgets)

        except ImportError:
            pass
        except __HOLE__:
            pass

    return widgets
dataset/ETHPy150Open treeio/treeio/treeio/core/dashboard/views.py/_get_all_widgets