A manager for our version of about:config
439007
function PrefList(prefsData, conversionContext) {
  this.search = prefsData.search;
  this.settings = prefsData.settings;
  this.conversionContext = conversionContext;

  this.onLoad = this.onLoad.bind(this);
}
1197080
def parser():

    """"""

    parser = argparse.ArgumentParser()
    parser.add_argument('-c', '--config_paths', default=[], action='append',
                        help='path to a configuration directory')
    return parser
1165435
def config(name='SEARCH_URL', default='simple://'):
    """"""
    config = {}

    s = env(name, default)

    if s:
        config = parse_search_url(s)

    return config
494859
def setup_user_manager(app):
    """"""

    from flask_user import SQLAlchemyAdapter

    from rio.models import User

    init = dict(
        db_adapter=SQLAlchemyAdapter(db, User),
    )
    user_manager.init_app(app, **init)
1047912
def _handle_config(self, data):
        """"""

        self.room.config.update(data)
        self.conn.enqueue_data("config", data)
1037662
function(baseDir, config) {
    this._baseDir = baseDir;
    this._config = _.merge({}, DEFAULT_CONFIG, config);
    this._folderPercentages = {};
}
744359
def _configure(configuration_details):
    """"""
    path = Path(configuration_details.path).expanduser()
    with path.open('a') as shell_config:
        shell_config.write(u'\n')
        shell_config.write(configuration_details.content)
        shell_config.write(u'\n')
548918
def handle_config_change(self, new_config):
        
        if self.user_handler:
            self.user_handler(self.current_config, new_config)
        self._call_spec_handlers(new_config)
        self.current_config = copy.deepcopy(new_config)
203981
def default_hass_config_dir():
    """"""
    data_dir = os.getenv("APPDATA") if os.name == "nt" else os.path.expanduser("~")
    return os.path.join(data_dir, ".homeassistant")
1316731
def config_make(config_file):
    """"""
    from pkg_resources import resource_filename
    import shutil
    if not os.path.exists(CONFIG_DIR):
        os.makedirs(CONFIG_DIR)
    filename = resource_filename("mcc", "config.ini")
    try:
        shutil.copyfile(filename, config_file)
    except IOError:
        print("Error copying sample config file: {}".format(config_file))
        sys.exit()
    print("Please add credential information to {}".format(config_file))
    sys.exit()
136953
def _configure_manager(self):
        
        self._manager = CloudBlockStorageManager(self,
                resource_class=CloudBlockStorageVolume, response_key="volume",
                uri_base="volumes")
        self._types_manager = BaseManager(self,
                resource_class=CloudBlockStorageVolumeType,
                response_key="volume_type", uri_base="types")
        self._snapshot_manager = CloudBlockStorageSnapshotManager(self,
                resource_class=CloudBlockStorageSnapshot,
                response_key="snapshot", uri_base="snapshots")
1362487
def manage_config(cmd, *args):
    """"""
    if cmd == "file":
        print(config.config_file)
    elif cmd == "show":
        with open(config.config_file) as f:
            print(f.read())
    elif cmd == "generate":
        fname = os.path.join(
                user_config_dir("genomepy"), "{}.yaml".format("genomepy")
            )
        
        if not os.path.exists(user_config_dir("genomepy")):
            os.makedirs(user_config_dir("genomepy"))
        
        with open(fname, "w") as fout:
            with open(config.config_file) as fin:
                fout.write(fin.read())
        print("Created config file {}".format(fname))
723522
def _configure_manager(self):
        
        self._manager = CloudDatabaseManager(self,
                resource_class=CloudDatabaseInstance, response_key="instance",
                uri_base="instances")
        self._flavor_manager = BaseManager(self,
                resource_class=CloudDatabaseFlavor, response_key="flavor",
                uri_base="flavors")
        self._backup_manager = CloudDatabaseBackupManager(self,
                resource_class=CloudDatabaseBackup, response_key="backup",
                uri_base="backups")
6074
def _configure_manager(self):
        
        self._manager = ScalingGroupManager(self,
                resource_class=ScalingGroup, response_key="group",
                uri_base="groups")
73949
function ErrorManager(generator, config, logger, fileManager) {
        this._generator = generator;
        this._config = config;
        this._logger = logger;

        this._fileManager = fileManager;

        this._errors = {};
        this._errorsAdded = {};
        this._errorsRemoved = false;
    }
214074
function ContentManager( config ) {

  var self = this;
  var filingCabinet;
  var contextFactory;

  //region Initialization

  function initialize() {
    var getRenderer = require( config.getRenderer ?
      path.join( './../../../', config.getRenderer ) :
      markedRenderer
    );
    var renderer = getRenderer( marked );
    filingCabinet = new FilingCabinet( config );

    readControls(
      config.controls,
      filingCabinet
    );
    readReferences(
      config.components,
      config.referenceFile,
      filingCabinet
    );
    readComponents(
      config.components,
      config.referenceFile,
      config.localeFile,
      config.layoutSegment,
      config.contentSegment,
      filingCabinet,
      renderer
    );
    readContents(
      config.contents,
      config.submenuFile,
      filingCabinet,
      renderer
    );

    logger.showInfo( '*** Validating elements...' );
    filingCabinet.finalize();
    logger.showInfo( '*** Content manager is initialized.' );

    contextFactory = new ContextFactory( config, filingCabinet );
  }

  //endregion

  initialize();

  //region Public properties

  /**
   * Gets the list of the supported locales.
   * @member {Array.<string>}
   * @readonly
   */
  Object.defineProperty( this, 'supportedLocales', {
    get: function () {
      return filingCabinet.languages;
    },
    enumerable: true,
    configurable: false
  } );

  //endregion

  //region Public methods

  /**
   * Sets up the middlewares of the markdown site engine.
   * @param {Express.Application} app - The express.js application.
   */
  this.setMiddlewares = function( app ) {

    // Set up language.
    app.use( function( req, res, next ) {

      if (!req.session)
        req.session = { language: negotiateLanguage(
          req.headers["accept-language"], filingCabinet.languages, config.defaultLocale
        ) };
      else if (!req.session.language)
        req.session.language = negotiateLanguage(
          req.headers["accept-language"], filingCabinet.languages, config.defaultLocale
        );
      next();
    } );

    // Set up request context.
    app.use( function( req, res, next ) {

      var language = req.session.language;
      var url = req.url;
      var definition = filingCabinet.contents.getDefinition( language, url );
      req.ctx = contextFactory.create( language, url, definition );

      // Apply eventual redirection.
      if (definition.rewrite)
        req.url = definition.rewrite;

      next();
    } );
  };

  /**
   * Sets up the routes of the user defined actions.
   * @param {Express.Application} app - The express.js application.
   * @param {object} actions - An object containing the URLs and paths of the actions.
   */
  this.setActions = function( app, actions ) {

    for (var property in actions) {
      var method = 'post';
      var url = property.toLowerCase();

      // Does property have method?
      var pos = url.indexOf( ':' );
      if (pos > 0) {
        method = url.substring( 0, pos );
        url = url.substring( pos + 1 );
      }
      // Add action handler.
      app[ method ]( url, function( req, res, next) {

        // Get action function.
        var action = require( path.join( '../../../', actions[ property ] ) );

        // Execute the action.
        action( req, req.ctx, function( resultUrl ) {
          req.url = resultUrl || '/404';
          next();
        });
      } );
      logger.routeAdded( url, method.toUpperCase() );
    }
  };

  /**
   * Sets up the routes of the markdown site engine.
   * @param {Express.Application} app - The express.js application.
   * @param {Boolean} isDevelopment - True when the application runs in environment environment.
   */
  this.setRoutes = function( app, isDevelopment ) {

    // Change language.
    app.use( config.paths.setLanguage, function( req, res ) {

      var len = req.baseUrl.length;
      var url = req.originalUrl.split( '?' )[ 0 ].substr( len );
      var curLanguage = req.session.language;
      var newLanguage = url.length > 1 ? url.substr( 1 ) : config.defaultLocale;

      req.session.language = newLanguage;
      var localizedPath = filingCabinet.getLocalizedPath(
        curLanguage, req.query[ 'id' ], newLanguage
      );
      res.redirect( localizedPath );
    } );
    logger.routeAdded( config.paths.setLanguage );

    // Reread the contents.
    app.use( config.paths.reboot, function( req, res ) {

      initialize();
      res.redirect( '/' );
    } );
    logger.routeAdded( config.paths.reboot );

    // Search the contents.
    var searchPaths = [ ];

    filingCabinet.languages.forEach( function( language ) {

      var searchPath = filingCabinet.contents.searchPath( language );
      if (searchPath && searchPaths.indexOf( searchPath ) < 0)
        searchPaths.push( searchPath );
    } );
    searchPaths.forEach( function( searchPath ) {

      app.post( searchPath, searchTheContents );
      logger.routeAdded( searchPath, 'POST' );
    } );

    // Developer methods.
    if (isDevelopment)
      setDeveloperRoutes( app, filingCabinet, config.paths, config.develop );

    // Serve contents.
    app.use( '*', function( req, res ) {

      var language = req.session.language;
      var url = req.baseUrl;
      var context = req.ctx;
      if (req.originalUrl !== req.baseUrl) {

        // Recreate the context for the rewritten path.
        var data = context.data;
        var definition = filingCabinet.contents.getDefinition( language, url );
        context = contextFactory.create( language, url, definition );
        Object.assign( context.data, data );
      }
      // Add eventual highlight text to context data.
      if (req.query.hl)
        context.data.highlight = req.query.hl;

      res.status( 200 ).send( filingCabinet.get( language, url, context ) );
    } );
    logger.routeAdded( '/* <all-contents>' );
  };

  function searchTheContents( req, res, next ) {

    // Initialize data.
    req.ctx.data.text2search = '';
    req.ctx.data.results = [ ];

    if (req.body) {
      // Search the required text in the contents.
      req.ctx.data.text2search = req.body.text2search;
      req.ctx.data.results = filingCabinet.contents.search( req.ctx );
    }
    else
      logger.showError( 'Middleware "body-parser" is not applied.' );

    next();
  }

  //endregion
}
607836
def setup_job(manager, job_id, tool_id, tool_version, use_metadata=False):
    
    job_id = manager.setup_job(job_id, tool_id, tool_version)
    if use_metadata:
        manager.enable_metadata_directory(job_id)
    return build_job_config(
        job_id=job_id,
        job_directory=manager.job_directory(job_id),
        system_properties=manager.system_properties(),
        tool_id=tool_id,
        tool_version=tool_version
    )