def init_subsystems(subsystem_types, options=None):
 for s in subsystem_types:
  if (not Subsystem.is_subsystem_type(s)):
   raise TypeError(u'{} is not a subclass of `Subsystem`'.format(s))
 optionables = Subsystem.closure(subsystem_types)
 if options:
  allowed_scopes = {o.options_scope for o in optionables}
  for scope in options.keys():
   if (scope not in allowed_scopes):
    raise ValueError(u'`{}` is not the scope of any of these subsystems: {}'.format(scope, optionables))
 updated_options = (dict(Subsystem._options.items()) if Subsystem._options else {})
 if options:
  updated_options.update(options)
 Subsystem.set_options(create_options_for_optionables(optionables, options=updated_options))

def init_subsystems ( subsystem_types , options = None ) : for s in subsystem_types : if ( not Subsystem . is_subsystem_type ( s ) ) : raise TypeError ( u'{} is not a subclass of `Subsystem`' . format ( s ) ) optionables = Subsystem . closure ( subsystem_types ) if options : allowed_scopes = { o . options_scope for o in optionables } for scope in options . keys ( ) : if ( scope not in allowed_scopes ) : raise ValueError ( u'`{}` is not the scope of any of these subsystems: {}' . format ( scope , optionables ) ) updated_options = ( dict ( Subsystem . _options . items ( ) ) if Subsystem . _options else { } ) if options : updated_options . update ( options ) Subsystem . set_options ( create_options_for_optionables ( optionables , options = updated_options ) )
initialize subsystems for use in tests .