def import_dashboard_config(modules):
 config = collections.defaultdict(dict)
 for module in modules:
  for (key, submodule) in import_submodules(module).items():
   if hasattr(submodule, 'DASHBOARD'):
    dashboard = submodule.DASHBOARD
    config[dashboard].update(submodule.__dict__)
   elif (hasattr(submodule, 'PANEL') or hasattr(submodule, 'PANEL_GROUP') or hasattr(submodule, 'FEATURE')):
    config[submodule.__name__] = submodule.__dict__
   else:
    logging.warning("Skipping %s because it doesn't have DASHBOARD, PANEL, PANEL_GROUP, or FEATURE defined.", submodule.__name__)
 return sorted(config.items(), key=(lambda c: c[1]['__name__'].rsplit('.', 1)[1]))

def import_dashboard_config ( modules ) : config = collections . defaultdict ( dict ) for module in modules : for ( key , submodule ) in import_submodules ( module ) . items ( ) : if hasattr ( submodule , 'DASHBOARD' ) : dashboard = submodule . DASHBOARD config [ dashboard ] . update ( submodule . __dict__ ) elif ( hasattr ( submodule , 'PANEL' ) or hasattr ( submodule , 'PANEL_GROUP' ) or hasattr ( submodule , 'FEATURE' ) ) : config [ submodule . __name__ ] = submodule . __dict__ else : logging . warning ( "Skipping %s because it doesn't have DASHBOARD, PANEL, PANEL_GROUP, or FEATURE defined." , submodule . __name__ ) return sorted ( config . items ( ) , key = ( lambda c : c [ 1 ] [ '__name__' ] . rsplit ( '.' , 1 ) [ 1 ] ) )
imports configuration from all the modules and merges it .