Instantiate the driver for each configuration. If no driver has been specified,
this will provide the config with a default driver.

The default driver is usually a null driver - which has no impact.
170333
function instantiateDrivers(config, defaultDriverInstance) {
    config.actionConfigs.forEach(action => {
            action.driverInstance=action.driver?action.driver():defaultDriverInstance;
    });
    return config;
}
1076337
private function driver() {
        $config = require(Dir::config());
        $db = $config['database'];

        switch(strtolower($db['driver'])) {
            case 'mysql':
                $driver = Dir::driverDatabase(ucwords(strtolower($db['driver'])));
                break;
            default:
                $driver = Dir::driverDatabase(ucwords(strtolower($db['driver'])));
                break;
        }

        return new $driver($db);
    }
404064
public function driver($driver = null)
    {
        $driver = $driver ?: $this->getDefaultDriver();

        if (is_null($driver)) {
            throw new InvalidArgumentException(sprintf('Unable to resolve NULL driver for [%s].', get_called_class()));
        }

        // If the given driver has not been created before, we will create the instances
        // here and cache it so we can return it next time very quickly. If there is
        // already a driver created by this name, we'll just return that instance.
        if (! isset($this->drivers[$driver])) {
            $this->drivers[$driver] = $this->createDriver($driver);
        }

        return $this->drivers[$driver];
    }
1057121
def driver(self):
        

        if not self._driver:
            raise AttributeError("`driver` is not bound on this agent implementation({}). "
                                 "Do you forget to call `super().on_bind_driver` when you override the method "
                                 "`on_bind_driver` in your sub class?"
                                 .format(repr(self)))
        return self._driver
283552
public static void loadDriver(String driverClassName) throws ClassNotFoundException {
        // let's try the thread context class loader first
        // let's try to use the system class loader
        try {
            Class.forName(driverClassName);
        }
        catch (ClassNotFoundException e) {
            try {
                Thread.currentThread().getContextClassLoader().loadClass(driverClassName);
            }
            catch (ClassNotFoundException e2) {
                // now let's try the classloader which loaded us
                try {
                    Sql.class.getClassLoader().loadClass(driverClassName);
                }
                catch (ClassNotFoundException e3) {
                    throw e;
                }
            }
        }
    }
1222746
private Configuration createDriverConfiguration(final Configuration driverConfiguration) {
    final ConfigurationBuilder configurationBuilder = Tang.Factory.getTang()
        .newConfigurationBuilder(driverConfiguration);
    for (final ConfigurationProvider configurationProvider : this.configurationProviders) {
      configurationBuilder.addConfiguration(configurationProvider.getConfiguration());
    }
    return configurationBuilder.build();
  }
143780
private function init()
    {
        // return the configurations from the config file
        $this->configurations = $this->helper->getConfigurations();

        // return an instance of the corresponding Provider concrete according to the configuration
        $this->provider = $this->provider_factory->create($this->configurations);
    }
106296
def get_driver_config(driver):  # noqa: E501
    

    response = errorIfUnauthorized(role='admin')
    if response:
        return response
    else:
        response = ApitaxResponse()

    # TODO: This needs an implementation, but likely requires a change to configs in apitaxcore

    return Response(status=200, body=response.getResponseBody())
21288
def configure(config=None, bind_in_runtime=True):
    """"""
    global _INJECTOR

    with _INJECTOR_LOCK:
        if _INJECTOR:
            raise InjectorException('Injector is already configured')

        _INJECTOR = Injector(config, bind_in_runtime=bind_in_runtime)
        logger.debug('Created and configured an injector, config=%s', config)
        return _INJECTOR
1210413
protected function _init() {
		if (!$this->_config['host'] && $this->_config['host'] !== false) {
			throw new ConfigException('No host configured.');
		}

		if ($this->_config['host'] === false) {
			$this->_config['dsn'] = sprintf(
				'pgsql:dbname=%s',
				$this->_config['database']
			);
		} else {
			$host = HostString::parse($this->_config['host']) + [
				'host' => static::DEFAULT_HOST,
				'port' => static::DEFAULT_PORT
			];
			$this->_config['dsn'] = sprintf(
				'pgsql:host=%s;port=%s;dbname=%s',
				$host['host'],
				$host['port'],
				$this->_config['database']
			);
		}
		parent::_init();
	}
973839
public function create()
    {
        foreach ($this->driverClasses as $driverClass) {
            try {
                $driver = new $driverClass();

                return $driver;
            } catch (\Exception $e) {
            }
        }

        return null;
    }
610947
public function create($configurations = array())
    {
        // get the default provider name
        $provider = isset($configurations['default']) ? $configurations['default'] : null;

        if (!$provider) {
            throw new MissingConfigurationException('Missing Configurations: Default Provider');
        }

        // prepare the full driver class name
        $driver_class = self::DRIVERS_NAMESPACE.ucwords($provider).'Provider';

        if (!class_exists($driver_class)) {
            throw new UnsupportedProviderException("CDN provider ($provider) is not supported");
        }

        // initialize the driver object and initialize it with the configurations
        $driver_object = App::make($driver_class)->init($configurations);

        return $driver_object;
    }
1233546
def make_driver(self, driver_name='generic'):
        """"""
        module_str = 'condoor.drivers.%s' % driver_name
        try:
            __import__(module_str)
            module = sys.modules[module_str]
            driver_class = getattr(module, 'Driver')
        except ImportError as e:  # pylint: disable=invalid-name
            print("driver name: {}".format(driver_name))
            self.chain.connection.log("Import error: {}: '{}'".format(driver_name, str(e)))
            # no driver - call again with default 'generic'
            return self.make_driver()

        self.chain.connection.log("Make Device: {} with Driver: {}".format(self, driver_class.platform))
        return driver_class(self)
794349
def init_drivers(enable_debug_driver=False):
    """"""
    for driver in DRIVERS:
        try:
            if driver != DebugDriver or enable_debug_driver:
                CLASSES.append(driver)
        except Exception:  # pylint: disable=W0703
            continue
927117
def create_and_configure_wrapper(context_or_world):
    
    # Create default driver wrapper
    context_or_world.driver_wrapper = DriverWrappersPool.get_default_wrapper()
    context_or_world.utils = context_or_world.driver_wrapper.utils

    # Get behave userdata properties to override config properties
    try:
        behave_properties = context_or_world.config.userdata
    except AttributeError:
        behave_properties = None

    # Configure wrapper
    context_or_world.driver_wrapper.configure(context_or_world.config_files, behave_properties=behave_properties)

    # Copy config object
    context_or_world.toolium_config = context_or_world.driver_wrapper.config

    # Configure logger
    context_or_world.logger = logging.getLogger(__name__)
90417
public static synchronized void init(Configuration conf) {
    if (!initDone) {
      DefaultConfiguration.conf = conf;
      DefaultConfiguration.initDone = true;
    }
  }
405655
def _init_config(self):
        

        system = platform.system().lower()
        leveldb_fallback_dir = os.path.expanduser("~")
        if system.startswith("darwin"):
            leveldb_fallback_dir = os.path.join(
                leveldb_fallback_dir, "Library", "Ethereum"
            )
        elif system.startswith("windows"):
            leveldb_fallback_dir = os.path.join(
                leveldb_fallback_dir, "AppData", "Roaming", "Ethereum"
            )
        else:
            leveldb_fallback_dir = os.path.join(leveldb_fallback_dir, ".ethereum")
        leveldb_fallback_dir = os.path.join(leveldb_fallback_dir, "geth", "chaindata")

        if not os.path.exists(self.config_path):
            log.info("No config file found. Creating default: " + self.config_path)
            open(self.config_path, "a").close()

        config = ConfigParser(allow_no_value=True)
        config.optionxform = str
        config.read(self.config_path, "utf-8")
        if "defaults" not in config.sections():
            self._add_default_options(config)

        if not config.has_option("defaults", "leveldb_dir"):
            self._add_leveldb_option(config, leveldb_fallback_dir)

        if not config.has_option("defaults", "dynamic_loading"):
            self._add_dynamic_loading_option(config)

        with codecs.open(self.config_path, "w", "utf-8") as fp:
            config.write(fp)

        leveldb_dir = config.get(
            "defaults", "leveldb_dir", fallback=leveldb_fallback_dir
        )
        return os.path.expanduser(leveldb_dir)