Configure robot loader
184062
public static function setupRobotLoader(?callable $callback = null): void
	{
		$loader = new RobotLoader();
		$loader->setTempDirectory(CACHE_DIR);

		if ($callback !== null) {
			$callback($loader);
		} else {
			$loader->addDirectory(ENGINE_DIR);
			$loader->addDirectory(APP_DIR);
			$loader->setAutoRefresh(true);
		}

		$loader->register();
	}
1349558
void initialize() {
        // Cancel any running tasks
        Timer oldTimer = timer;
        timer = new Timer(true);
        if (Objects.nonNull(oldTimer)) {
            oldTimer.cancel();
        }
        // (re)initialize
        LoaderConfigurator configurator = new LoaderConfigurator(this);
        defaultLoaderServiceFacade = new DefaultLoaderServiceFacade(timer, listener, resources);
        configurator.load();
    }
445137
protected function setPluginAutoloading()
    {
        foreach ($this->config('plugin.autoloading', []) as $ns => $path) {
            $path = $this->dirPath.'/'.trim($path, '\/');
            $this->loader->addPsr4($ns, $path);
        }

        $this->loader->register();
    }
499769
protected function configure()
    {
        parent::configure();

        $this->addOption(
            'json',
            '',
            InputOption::VALUE_OPTIONAL,
            'Path to the json definition.'
        )
            ->addOption(
                'srcDir',
                '',
                InputOption::VALUE_OPTIONAL,
                'Src Dir',
                dirname(__FILE__) . '/../../../'
            )
            ->addOption(
                'bundleBundleName',
                '',
                InputOption::VALUE_OPTIONAL,
                'Which BundleBundle to manipulate to add our stuff',
                'GravitonDynBundleBundle'
            )
            ->setName('graviton:generate:dynamicbundles')
            ->setDescription(
                'Generates all dynamic bundles in the GravitonDyn namespace. Either give a path '.
                'to a single JSON file or a directory path containing multiple files.'
            );
    }
468163
def add_robot(self, controller):
        """"""

        # connect to the controller
        # -> this is to support module robots
        controller.on_mode_change(self._on_robot_mode_change)
        self.robots.append(controller)
1361702
public function setLoader(Loader $loader)
    {
        $this->loader = $loader;
        $this->loader->setNamespace($this->getNamespace());
    }
165351
function load (robot) {
  robot.respond(/\b(clean room|clr)( from (.*))?(\.|!|)?$/i, async (res) => {
    try {
      const from = res.match[3] || 'May 19, 2015 04:36:09' // clear all if not given date
      const oldest = new Date(from).toISOString()
      const cleaned = await cleanRoomHistory(robot, res.message.user, oldest).catch()
      if (typeof cleaned === 'undefined') {
        res.reply(`Sorry, I'm afraid I can't do that.`)
      }
    } catch (err) {
      res.reply(`That wasn't a valid date`)
    }
  })
}
684399
def configure(self, **options):
        """"""
        super(GraphiteAlert, self).configure(**options)

        self.method = options.get('method', self.reactor.options['method'])
        self.default_nan_value = options.get(
            'default_nan_value', self.reactor.options['default_nan_value'])
        self.ignore_nan = options.get('ignore_nan', self.reactor.options['ignore_nan'])
        assert self.method in METHODS, "Method is invalid"

        self.auth_username = self.reactor.options.get('auth_username')
        self.auth_password = self.reactor.options.get('auth_password')
        self.validate_cert = self.reactor.options.get('validate_cert', True)

        self.url = self._graphite_url(
            self.query, graphite_url=self.reactor.options.get('graphite_url'), raw_data=True)
        LOGGER.debug('%s: url = %s', self.name, self.url)
1104486
public function configure()
    {
        // environment
        $this->setEnv($this->getEnvFromEnvironmentVariables());

        // application root dir.
        $this->config('directory.root', dirname(dirname(__DIR__)));
        
        // application dir.
        $this->addAppPathUsePsr4(__DIR__, __NAMESPACE__, 'Samurai\\', self::PRIORITY_LOW);

        // set directory names.
        $this->config('directory.config.samurai', 'Config/Samurai');
        $this->config('directory.config.routing', 'Config/App');
        $this->config('directory.config.database', 'Config/Database');
        $this->config('directory.config.renderer', 'Config/Renderer');
        $this->config('directory.controller', 'Controller');
        $this->config('directory.model', 'Model');
        $this->config('directory.filter', 'Filter');
        $this->config('directory.layout', 'View/Layout');
        $this->config('directory.template', 'View');
        $this->config('directory.database.data', 'Database');
        $this->config('directory.database.migration', 'Database/Migration');
        $this->config('directory.database.seed', 'Database/Seed');
        $this->config('directory.database.schema', 'Database/Schema');
        $this->config('directory.locale', 'Locale');
        $this->config('directory.task', 'Task');
        $this->config('directory.spec', 'Spec');
        $this->config('directory.skeleton', 'Skeleton');
        $this->config('directory.log', 'Log');
        $this->config('directory.temp', 'Temp');

        // controllers
        $this->config('controller.namespaces', ['Samurai\Samurai']);
        
        // main dicon
        $this->config('container.dicon.', 'Config/Samurai/samurai.dicon');

        // set encodings.
        $this->config('encoding.input', 'UTF-8');
        $this->config('encoding.output', 'UTF-8');
        $this->config('encoding.internal', 'UTF-8');
        $this->config('encoding.text.html', 'UTF-8');

        // set caches.
        $this->config('cache.yaml.enable', true);
        $this->config('cache.yaml.expire', 60 * 60 * 24);    // 1 day
        
        // timezone.
        $this->config('locale', 'ja');
        $this->setTimezone('Asia/Tokyo');
        
        // autoload by samurai
        $loader = new Loader($this);
        $loader->register();
        $this->loader = $loader;
    }
186866
def init(config_object: Optional[Any] = None) -> None:
    
    global _bot
    _bot = NoneBot(config_object)

    if _bot.config.DEBUG:
        logger.setLevel(logging.DEBUG)
    else:
        logger.setLevel(logging.INFO)

    _bot.server_app.before_serving(_start_scheduler)
329297
function init(loader) {
  var loaderConfig = loaderUtils.getLoaderConfig(loader, 'web3Loader');
  web3 = require('./lib/web3')(loaderConfig.provider);
  config = mergeConfig(loaderConfig);
  isDebug = loader.debug;
}
787580
protected function configure()
    {
        $this
            ->addOption('explain', '', InputOption::VALUE_NONE, 'Explains the commands that would be executed.')
            ->addOption('force', 'f', InputOption::VALUE_NONE, 'Force execution of otherwise skipped tasks.')
            ->addOption('plugin', '', InputOption::VALUE_REQUIRED, 'Load additional plugins on-the-fly')
            ->addOption('debug', '', InputOption::VALUE_NONE, "Set the debug flag")
        ;
    }
712169
protected function configure()
    {
        $curlOptions = [];

        if ($this->config['cache.disabled']) {
            $this->simplePie->enable_cache(false);
        } else {
            $this->simplePie->set_cache_location($this->config['cache.location']);
            $this->simplePie->set_cache_duration($this->config['cache.life']);
        }

        if (isset($this->config['curl.options']) && is_array($this->config['curl.options'])) {
            $curlOptions += $this->config['curl.options'];
        }

        if ($this->config['ssl_check.disabled']) {
            $curlOptions[CURLOPT_SSL_VERIFYHOST] = false;
            $curlOptions[CURLOPT_SSL_VERIFYPEER] = false;
        }

        if (is_array($curlOptions)) {
            $this->simplePie->set_curl_options($curlOptions);
        }
    }
85723
def _setup(self, action, line):
        ''' 
        '''
        bot.debug('[in]  %s' % line)

        # Replace ACTION at beginning
        line = re.sub('^%s' % action, '', line)

        # Handle continuation lines without ACTION by padding with leading space
        line = " " + line

        # Split into components
        return [x for x in self._split_line(line) if x not in ['', None]]
1021781
def configure(self, src_dir, build_dir, **kwargs):
        """"""
        del kwargs
        ex_path = self._ex_args.get("project_path")
        if ex_path:
            src_dir = os.path.join(src_dir, ex_path)

        return [{"args": ["cmake", src_dir] + self._config_args, "cwd": build_dir}]
1278340
public function loadConfiguration(): void
	{
		$builder = $this->getContainerBuilder();
		$config = $this->validateConfig($this->defaults);
		$config = Helpers::expand($config, $builder->parameters);

		// Scheduler
		$scheduler = $builder->addDefinition($this->prefix('scheduler'))
			->setFactory(LockingScheduler::class, [$config['path']]);

		// Commands
		$builder->addDefinition($this->prefix('runCommand'))
			->setFactory(RunCommand::class)
			->setAutowired(false);
		$builder->addDefinition($this->prefix('listCommand'))
			->setFactory(ListCommand::class)
			->setAutowired(false);
		$builder->addDefinition($this->prefix('helpCommand'))
			->setFactory(HelpCommand::class)
			->setAutowired(false);

		// Jobs
		foreach ($config['jobs'] as $key => $job) {
			if (is_array($job)) {
				$job = new Statement(CallbackJob::class, [$job['cron'], $job['callback']]);
			} else {
				$job = new Statement($job);
			}

			$scheduler->addSetup('add', [$job, $key]);
		}
	}
666370
def connect_to_robot():
    '''
    
    '''
    print()
    import optparse
    from opentrons import robot
    print('Connecting to robot...')
    parser = optparse.OptionParser(usage='usage: %prog [options] ')
    parser.add_option(
        "-p", "--p", dest="port", default='',
        type='str', help='serial port of the smoothie'
    )

    options, _ = parser.parse_args(args=None, values=None)
    if options.port:
        robot.connect(options.port)
    else:
        robot.connect()
    return robot