<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _process_panel_configuration(self, config):
 """Add, remove and set default panels on the dashboard."""

        try:
            dashboard = config.get('PANEL_DASHBOARD')
            if not dashboard:
                LOG.warning("Skipping %s because it doesn't have "
                            "PANEL_DASHBOARD defined.", config.__name__)
                return
            panel_slug = config.get('PANEL')
            dashboard_cls = self.get_dashboard(dashboard)
            panel_group = config.get('PANEL_GROUP')
            default_panel = config.get('DEFAULT_PANEL')

            # Set the default panel
            if default_panel:
                dashboard_cls.default_panel = default_panel

            # Remove the panel
            if config.get('REMOVE_PANEL', False):
                for panel in dashboard_cls.get_panels():
                    if panel_slug == panel.slug:
                        dashboard_cls.unregister(panel.__class__)
            elif config.get('ADD_PANEL', None):
                # Add the panel to the dashboard
                panel_path = config['ADD_PANEL']
                mod_path, panel_cls = panel_path.rsplit(".", 1)
                try:
                    mod = import_module(mod_path)
                except ImportError as e:
                    LOG.warning("Could not import panel module %(module)s: "
                                "%(exc)s", {'module': mod_path, 'exc': e})
                    return
                panel = getattr(mod, panel_cls)
                # test is can_register method is present and call method if
                # it is to determine if the panel should be loaded
                if hasattr(panel, 'can_register') and \
                   callable(getattr(panel, 'can_register')):
                    if not panel.can_register():
                        LOG.debug("Load condition failed for panel: %(panel)s",
                                  {'panel': panel_slug})
                        return
                dashboard_cls.register(panel)
                if panel_group:
                    dashboard_cls.get_panel_group(panel_group).\
                        panels.append(panel.slug)
                else:
                    panels = list(dashboard_cls.panels)
                    panels.append(panel)
                    dashboard_cls.panels = tuple(panels)
        except Exception as e:
            LOG.warning('Could not process panel %(panel)s: %(exc)s',
                        {'panel': panel_slug, 'exc': e})