Reads the config value for browser type.
181338
def __create_driver_from_browser_config(self):
        '''
        
        '''
        try:
            browser_type = self._config_reader.get(
                WebDriverFactory.BROWSER_TYPE_CONFIG)
        except KeyError:
            _wtflog("%s missing is missing from config file. Using defaults",
                    WebDriverFactory.BROWSER_TYPE_CONFIG)
            browser_type = WebDriverFactory.FIREFOX

        # Special Chrome Sauce
        options = webdriver.ChromeOptions()
        options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])
        options.add_argument("always-authorize-plugins")

        browser_type_dict = {
            self.CHROME: lambda: webdriver.Chrome(
                self._config_reader.get(WebDriverFactory.CHROME_DRIVER_PATH),
                chrome_options=options),
            self.FIREFOX: lambda: webdriver.Firefox(),
            self.INTERNETEXPLORER: lambda: webdriver.Ie(),
            self.OPERA: lambda: webdriver.Opera(),
            self.PHANTOMJS: lambda: self.__create_phantom_js_driver(),
            self.SAFARI: lambda: self.__create_safari_driver()
        }

        try:
            return browser_type_dict[browser_type]()
        except KeyError:
            raise TypeError(
                u("Unsupported Browser Type {0}").format(browser_type))
1247231
def _guess_content_type(url):
    '''
    
    '''
    OCTET_STREAM = 'application/octet-stream'
    n = url.rfind('.')
    if n == -1:
        return OCTET_STREAM
    return mimetypes.types_map.get(url[n:].lower(), OCTET_STREAM)
1058825
def read_cf1_config(self):
        """"""
        target = self._cload.targets[0xFF]
        config_page = target.flash_pages - 1

        return self._cload.read_flash(addr=0xFF, page=config_page)
614632
def read_config():
    
    if not os.path.isfile(CONFIG):
        with open(CONFIG, "w"):
            pass

    parser = ConfigParser()
    parser.read(CONFIG)

    return parser
1079789
function readServerConfig( server ) {
  try {
    const severConfig = getConfig( appSeverConfig );
    return Right( Object.assign( server, severConfig ));
  } catch ( e ) {
    print(
      chalk.red( `Failed to read ${SEVER_CONFIG}.` ),
      e.message
    );
    print();
    return Left( null );
  }
}
327948
def _parse_website_config(self, (response, xml_bytes)):
        """"""
        root = XML(xml_bytes)
        index_suffix = root.findtext("IndexDocument/Suffix")
        error_key = root.findtext("ErrorDocument/Key")

        return WebsiteConfiguration(index_suffix, error_key)
576881
def read_config(contents):
    
    file_obj = io.StringIO(contents)
    config = six.moves.configparser.ConfigParser()
    config.readfp(file_obj)
    return config
872412
function browserSpecific() {
    var data = '';
    return through(
        function(buf) {
            data += buf;
        },
        function() {
            this.queue(data.replace(/\.\/node\//g, './browser/'));
            this.queue(null);
        }
    );
}
33230
static InternalConfig readInternal() {
        final InputStream versionStream = ConfigFactory.class.getResourceAsStream(INTERNAL_CONFIG_PATH);
        final InputStreamReader reader = new InputStreamReader(versionStream);
        return new Gson().fromJson(reader, InternalConfig.class);
    }
533324
def get_config_type(filename):
    
    if is_json_file(filename):
        return("json")
    elif is_ini_file(filename):
        return("ini")
    elif is_yaml_file(filename):
        return("yaml")
    elif is_toml_file(filename):
        return("toml")
    else:
        return(False)
877655
function readINISettings()
    {
        $this->readImageHandlersFromINI();
        $this->readSupportedFormatsFromINI();
        $this->readImageAliasesFromINI();
        $this->readMIMETypeSettingsFromINI();
        $this->readMIMETypeQualitySettingFromINI();
        $this->readConversionRuleSettingsFromINI();
    }
579836
function readFromLocalConfig(parent){
    return readFile(config_file(parent), "utf8")
        .then(function(contents){
            return JSON.parse(contents);
        })
        .catch(function(){
            return {
                data: {},
                installed: [],
            };
        });
}
764491
function readConfig() {
  const patten = `${process.cwd()}/config/*.json`
  return glob.sync(patten).reduce((acc, curr) => {
    var ctx = !env ? require(curr) : require(curr)[env]
    return Object.assign({}, acc, ctx)
  }, {})
}
395813
function Config(conf){
  try{
    if(typeof conf === 'string'){
      this.confPath = conf;
      conf = ini.parse(fs.readFileSync(conf, 'utf8'));
    }
  }catch(e){
    conf = {}
  }
  this.conf= conf || {};
}
45484
private void readConfig()
        throws CacheReloadException
    {
        Connection con = null;
        try {
            boolean closeContext = false;
            if (!Context.isThreadActive()) {
                Context.begin();
                closeContext = true;
            }
            final List<Object[]> dbValues = new ArrayList<>();
            con = Context.getConnection();
            PreparedStatement stmt = null;
            try {
                stmt = con.prepareStatement(SystemConfiguration.SQL_CONFIG);
                stmt.setObject(1, getId());
                final ResultSet rs = stmt.executeQuery();

                while (rs.next()) {
                    dbValues.add(new Object[] {
                                    rs.getLong(1),
                                    rs.getString(2),
                                    rs.getString(3),
                                    rs.getLong(4),
                                    rs.getString(5)
                    });
                }
                rs.close();
            } finally {
                if (stmt != null) {
                    stmt.close();
                }
            }
            con.commit();
            if (closeContext) {
                Context.rollback();
            }
            for (final Object[] row : dbValues) {
                final Long typeId = (Long) row[0];
                final String key = (String) row[1];
                final String value = (String) row[2];
                final Long companyId = (Long) row[3];
                final String appkey = (String) row[4];
                final Type type = Type.get(typeId);
                final ConfType confType;
                if (type.equals(CIAdminCommon.SystemConfigurationLink.getType())) {
                    confType = ConfType.LINK;
                } else if (type.equals(CIAdminCommon.SystemConfigurationObjectAttribute.getType())) {
                    confType = ConfType.OBJATTR;
                } else {
                    confType = ConfType.ATTRIBUTE;
                }
                values.add(new Value(confType, key, value, companyId, appkey));
            }
        } catch (final SQLException e) {
            throw new CacheReloadException("could not read SystemConfiguration attributes", e);
        } catch (final EFapsException e) {
            throw new CacheReloadException("could not read SystemConfiguration attributes", e);
        } finally {
            try {
                if (con != null && !con.isClosed()) {
                    con.close();
                }
            } catch (final SQLException e) {
                throw new CacheReloadException("Cannot read a type for an attribute.", e);
            }
        }
    }
332304
function setConfig(defaultConfig, server) {
    if (server === 'ne') {
        defaultConfig.captureTimeout = 100000;

        defaultConfig.customLaunchers = {
            'IE8': {
                base: 'WebDriver',
                config: webdriverConfig,
                browserName: 'internet explorer',
                version: '8'
            },
            'IE9': {
                base: 'WebDriver',
                config: webdriverConfig,
                browserName: 'internet explorer',
                version: '9'
            },
            'IE10': {
                base: 'WebDriver',
                config: webdriverConfig,
                browserName: 'internet explorer',
                version: '10'
            },
            'IE11': {
                base: 'WebDriver',
                config: webdriverConfig,
                browserName: 'internet explorer',
                version: '11'
            },
            'Edge': {
                base: 'WebDriver',
                config: webdriverConfig,
                browserName: 'MicrosoftEdge'
            },
            'Chrome-WebDriver': {
                base: 'WebDriver',
                config: webdriverConfig,
                browserName: 'chrome'
            },
            'Firefox-WebDriver': {
                base: 'WebDriver',
                config: webdriverConfig,
                browserName: 'firefox'
            },
            'Safari-WebDriver': {
                base: 'WebDriver',
                config: webdriverConfig,
                browserName: 'safari'
            }
        };

        // start these browsers
        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
        defaultConfig.browsers = [
            'IE8',
            'IE9',
            'IE10',
            'IE11',
            'Edge',
            'Chrome-WebDriver',
            'Firefox-WebDriver'
            // 'Safari-WebDriver' // active only when safari test is needed
        ];

        defaultConfig.webpack.module.preLoaders = [{
            test: /\.js$/,
            include: path.resolve('./src/js'),
            loader: 'istanbul-instrumenter'
        }];

        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        defaultConfig.reporters = [
            'dots',
            'coverage',
            'junit'
        ];

        // optionally, configure the reporter
        defaultConfig.coverageReporter = {
            dir: 'report/coverage/',
            reporters: [
                {
                    type: 'html',
                    subdir: function(browser) {
                        return 'report-html/' + browser;
                    }
                },
                {
                    type: 'cobertura',
                    subdir: function(browser) {
                        return 'report-cobertura/' + browser;
                    },
                    file: 'cobertura.txt'
                }
            ]
        };

        defaultConfig.junitReporter = {
            outputDir: 'report/junit',
            suite: ''
        };
    } else {
        defaultConfig.captureTimeout = 60000;

        defaultConfig.reporters = [
            'karmaSimpleReporter'
        ];

        defaultConfig.specReporter = {
            suppressPassed: true,
            suppressSkipped: true,
            suppressErrorSummary: true
        };

        // start these browsers
        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
        defaultConfig.browsers = [
            'ChromeHeadless'
        ];
    }
}
1135045
def _from_type(self, config):
        
        def is_user_attribute(attr):
            return (
                not attr.startswith('__') and
                not isinstance(getattr(config, attr), collections.abc.Callable)
            )

        return {attr: getattr(config, attr) for attr in dir(config) \
                                                    if is_user_attribute(attr)}