#region Configuration
428868
function
configure(options) {

  var config = {
    context: {},
    extension: '.html',
    verbose: false,
    renderString: false,
    piping: true
  };
  if (options === undefined || options === null)
    options = {};
  else
    options = cloneDeep(options);

  configureErrors(config, options);
  configureVerbosity(config, options);
  configureGlobals(config, options);
  configureLocals(config, options);
  configureContext(config, options);
  configureFiles(config, options);
  configureNunjucks(config, options);
  configurePluginOptions(config, options);

  return config;
}
1180854
protected void setRegion(float cx, float cy) {
		x0 = cx - radius;
		y0 = cy - radius;

		if( x0 < 0 ) { x0 = 0;}
		else if( x0+width > image.width ) { x0 = image.width-width; }
		if( y0 < 0 ) { y0 = 0;}
		else if( y0+width > image.height ) { y0 = image.height-width; }

	}
361637
public function initRbacModules()
    {
        $this->stdout("Init rules, permissions adn data from all modules and extensions\n", Console::BOLD);
        $this->stdout("\t1) Loading config\n", Console::FG_YELLOW);
        if (!$config = $this->loadConfig()) {
            $this->stdout("Start script: not found data for rbac migrations", Console::FG_RED);
            die;
        }
        $this->stdout("\t2) Start migrations\n", Console::FG_YELLOW);
        $this->applyConfig($config);
        $this->stdout("\t3) Assigning roles, privileges, rules\n", Console::FG_YELLOW);
        $this->applyAssigningConfig($config);
    }
134644
def region_selection(request):
    ''' '''
    form = get_region_select_form(request.GET)
    abbr = form.data.get('abbr')
    if not abbr or len(abbr) != 2:
        return redirect('homepage')
    return redirect('region', abbr=abbr)
1138538
function(config, parent_config) {

		var locale_cache = {};

		if ('resources' in config) {

			if (Lava.schema.LOCALE in config.resources) {
				locale_cache = Lava.resources.mergeResources(locale_cache, config.resources[Lava.schema.LOCALE]);
			}
			if ('default' in config.resources) {
				locale_cache = Lava.resources.mergeResources(locale_cache, config.resources['default']);
			}

		}

		if (parent_config && ('resources_cache' in parent_config)) {

			locale_cache = Lava.resources.mergeResources(locale_cache, parent_config.resources_cache[Lava.schema.LOCALE]);

		}

		if (!Firestorm.Object.isEmpty(locale_cache)) {

			config.resources_cache = {};
			config.resources_cache[Lava.schema.LOCALE] = locale_cache;

		}

	}
467840
protected function prepare_per_region_arrays() {
        $result = array();
        foreach ($this->regions as $region => $notused) {
            $result[$region] = array();
        }
        return $result;
    }
292609
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            foreach ($params as $param) {
                switch ($param->getType()) {
                    case self::DOMAIN_KEY:
                        $this->setDomain($param->getValue());
                        break;
                    case self::DIR_KEY:
                        $this->setDir($this->project->resolveFile($param->getValue()));
                        break;

                    case self::LOCALE_KEY:
                        $this->setLocale($param->getValue());
                        break;
                } // switch
            }
        } // if params !== null
    }
502537
@Override
    protected void configure() {
        bind(new TypeLiteral<String>() {
        }).annotatedWith(Names.named("simulatorContentType")).toInstance("txt");

        bind(new TypeLiteral<String>() {
        }).annotatedWith(Names.named("encoding")).toInstance("Cp278");

        bind(new TypeLiteral<Integer>() {
        }).annotatedWith(Names.named("headerLength")).toInstance(48);

        bind(new TypeLiteral<Integer>() {
        }).annotatedWith(Names.named("headerBodyLengthBeginIndex")).toInstance(4);

        bind(new TypeLiteral<Integer>() {
        }).annotatedWith(Names.named("headerBodyLengthEndIndex")).toInstance(8);
    }
153613
private void verboseRegionCmd(String pCmd, Rectangle pBounds, Area pRegion) {
        System.out.println(pCmd + ": " + pBounds);
//        System.out.print("Region points: ");
//        if (pPolygon != null && pPolygon.npoints > 0) {
//            System.out.print("(" + pPolygon.xpoints[0] + "," + pPolygon.ypoints[0] + ")");
//        }
//        for (int i = 1; pPolygon != null && i < pPolygon.npoints; i++) {
//            System.out.print(", (" + pPolygon.xpoints[i] + "," + pPolygon.ypoints[i] + ")");
//        }
        System.out.println();
    }
387981
def parse_region(self):
        """"""

        try:
            auth_url = self.job_args['os_auth_url']
            if 'tokens' not in auth_url:
                if not auth_url.endswith('/'):
                    auth_url = '%s/' % auth_url
                auth_url = urlparse.urljoin(auth_url, 'tokens')
            return auth_url
        except KeyError:
            raise exceptions.AuthenticationProblem(
                'You Are required to specify an Auth URL, Region or Plugin'
            )
1053774
public void setRegion(int left, int top, int width, int height) {
    if (top < 0 || left < 0) {
      throw new IllegalArgumentException("Left and top must be nonnegative");
    }
    if (height < 1 || width < 1) {
      throw new IllegalArgumentException("Height and width must be at least 1");
    }
    int right = left + width;
    int bottom = top + height;
    if (bottom > this.height || right > this.width) {
      throw new IllegalArgumentException("The region must fit inside the matrix");
    }
    for (int y = top; y < bottom; y++) {
      int offset = y * rowSize;
      for (int x = left; x < right; x++) {
        bits[offset + (x / 32)] |= 1 << (x & 0x1f);
      }
    }
  }
459565
public function unsetTemporaryRegion(): self
	{
		if ($this->isSettingSet(self::SET_ORIG_REGION))
		{
			$region = $this->getSetting(self::SET_ORIG_REGION);
			$this->setSetting(self::SET_REGION, $region);
			$this->setSetting(self::SET_PLATFORM, $this->platforms->getPlatformName($region));
			$this->setSetting(self::SET_ORIG_REGION, null);
		}
		return $this;
	}
1079294
def _load_region(self, acct_id, region_name, path):
        """"""
        lim_path = os.path.join(path, 'limit_overrides.json')
        thresh_path = os.path.join(path, 'threshold_overrides.json')
        res = {'limit_overrides': {}, 'threshold_overrides': {}}
        if os.path.exists(lim_path):
            with open(lim_path, 'r') as fh:
                res['limit_overrides'] = json.loads(fh.read())
        if os.path.exists(thresh_path):
            with open(thresh_path, 'r') as fh:
                res['threshold_overrides'] = json.loads(fh.read())
        self._config[acct_id]['regions'][region_name] = res
673090
def configure(conf)
      super
      @host = conf['host']
      @port = conf['port']
      @token = conf['token']
      @hostname = conf['hostname'] || Socket.gethostname.split('.').first

      # Determine mapping of record keys to syslog keys
      @mappings = {}
      SYSLOG_HEADERS.each do |key_name|
        conf_key = "#{key_name}_key"
        @mappings[key_name] = conf[conf_key] if conf.key?(conf_key)
      end
    end
57636
public static function configure(){
        $args = func_get_args();
        $numArgs = func_num_args();

        switch ($numArgs) {
            case 1:{
                if (is_array($args[0])){
                    self::configureWithOptions($args[0]);
                } else {
                    self::configureWithDsnAndOptions($args[0]);
                }
                break;
            }
            case 2:{
                if (is_array($args[0])){
                    self::configureWithOptions($args[0], $args[1]);
                } else {
                    self::configureWithDsnAndOptions($args[0], $args[1]);
                }
                break;
            }
            case 3: {
                self::configureWithDsnAndOptions($args[0], $args[1], $args[2]);
                break;
            }
        }
    }
631434
@Override
    public void setup() {

        if (log.isInfoEnabled()) {
            log.info("Setting default locale to [" + newLocale + "]");
        }

        try {
            Locale.setDefault(newLocale);
        } catch (Exception e) {
            log.error("Could not switch locale to ["
                    + newLocale + "]. Continuing with standard locale.", e);
        }
    }
533670
public function configureSettings()
    {
        // If no settings && sections, return.
        $settings = $this->repository()->getSettings();
        $sections = $this->repository()->getSections();

        if ($settings->isEmpty() && $sections->isEmpty()) {
            return;
        }

        // Configure sections.
        $sections->each(function ($section) {
            /** @var SectionInterface $section */
            add_settings_section($section->getId(), $section->getTitle(), [$this, 'renderSections'], $this->getSlug());
        });

        // Configure settings.
        foreach ($settings->all() as $slug => $fields) {
            foreach ($fields as $setting) {
                $setting = $this->prepareSetting($setting);

                // Display the setting.
                add_settings_field(
                    $setting->getName(),
                    $setting->getOption('label'),
                    [$this, 'renderSettings'],
                    $this->getSlug(),
                    $slug,
                    $setting
                );

                // Validate setting.
                $showInRest = $this->isShownInRest();

                if ($setting->getOption('show_in_rest', false)) {
                    $showInRest = true;
                }

                register_setting($this->getSlug(), $setting->getName(), [
                    'sanitize_callback' => [$this, 'sanitizeSetting'],
                    'default' => $setting->getOption('data', ''),
                    'show_in_rest' => $showInRest,
                    'type' => $setting->getOption('data_type', 'string')
                ]);
            }
        }
    }