Internal method to set up the region manager
339123
function(){
    this._regionManager = new Marionette.RegionManager();

    this.listenTo(this._regionManager, "region:add", function(name, region){
      this[name] = region;
    });

    this.listenTo(this._regionManager, "region:remove", function(name, region){
      delete this[name];
    });
  }
300854
@Setup(Level.Trial)
    public void setupFeatureManager() {
        FeatureManager featureManager = new FeatureManagerBuilder()
                .featureEnums(SystemPropertyActivationStrategyFeatures.class)
                .stateRepository(new InMemoryStateRepository())
                .userProvider(new NoOpUserProvider())
                .build();
        // set up the toggle activation state
        StaticFeatureManagerProvider.setFeatureManager(featureManager);
        manager = featureManager;

        FeatureState propertBasedFeatureState = new FeatureState(SystemPropertyActivationStrategyFeatures.SYSTEM_BASED_FEATURE)
            .setEnabled(true)
            .setStrategyId(SystemPropertyActivationStrategy.ID)
            .setParameter(SystemPropertyActivationStrategy.PARAM_PROPERTY_NAME, "foo.bar")
            .setParameter(SystemPropertyActivationStrategy.PARAM_PROPERTY_VALUE, "true");


        manager.setFeatureState(propertBasedFeatureState);


    }
1168488
def set_default_region(self, region):
        
        region = _convert_to_charp(region)
        self._set_default_region_func(self.alpr_pointer, region)
583172
public void initSystem() {
        createIzouPropertiesFile();
        setSystemProperties();
        reloadFile(null);

        try {
            if (System.getProperty(IZOU_CONFIGURED).equals("false")) {
                fatal("Izou not completely configured, please configure Izou and launch again.");
                System.exit(0);
            }
        } catch (NullPointerException e) {
            fatal("Izou not completely configured, please configure Izou by editing izou.properties in the " +
                    "properties folder and launch again.");
            System.exit(0);
        }
    }
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;
	}
477018
function initAwsStuff(region = DEFAULT_REGION) {
    ec2 = new AWS.EC2({ region });
    // ecr = new AWS.ECR({ region });
    s3 = new AWS.S3();
    sts = new AWS.STS();

    SSM = new AwsSSM(region);
    ECR = new AwsECR(region);
    CF = new AwsCF(region);
}
1309219
@Setup(Level.Trial)
    public void setupFeatureManager() {
        FeatureManager featureManager = new FeatureManagerBuilder()
                .featureEnums(ReleaseDateBenchmarkFeature.class)
                .stateRepository(new InMemoryStateRepository())
                .userProvider(new NoOpUserProvider())
                .build();
        // set up the toggle activation state
        StaticFeatureManagerProvider.setFeatureManager(featureManager);
        manager = featureManager;

        FeatureState releaseDateFeatureState = new FeatureState(ReleaseDateBenchmarkFeature.RELEASE_DATE_STRATEGY_ENABLED);
        releaseDateFeatureState.setEnabled(true);
        releaseDateFeatureState.setStrategyId(ReleaseDateActivationStrategy.ID);
        releaseDateFeatureState.setParameter(ReleaseDateActivationStrategy.PARAM_DATE, "2014-12-31");
        releaseDateFeatureState.setParameter(ReleaseDateActivationStrategy.PARAM_TIME, "12:45:00");

        FeatureState disabledReleaseDate = new FeatureState(ReleaseDateBenchmarkFeature.RELEASE_DATE_STRATEGY_DISABLED);
        disabledReleaseDate.setEnabled(false);
        disabledReleaseDate.setStrategyId(ReleaseDateActivationStrategy.ID);
        disabledReleaseDate.setParameter(ReleaseDateActivationStrategy.PARAM_DATE, "2014-12-31");
        disabledReleaseDate.setParameter(ReleaseDateActivationStrategy.PARAM_TIME, "12:45:00");

        manager.setFeatureState(releaseDateFeatureState);
        manager.setFeatureState(new FeatureState(ReleaseDateBenchmarkFeature.DISABLED_BY_FEATURE_STATE, false));
        manager.setFeatureState(disabledReleaseDate);
    }
441812
private void configureEnabled(Manager manager) {
		if (enabled != manager.isEnabled()) {
			if (enabled) {
				manager.enable();
			} else {
				manager.disable();
			}
		}
	}
824210
@Override
    public void unlockRegion(SoftLock lock) throws CacheException {
        log.debug("region access strategy unlockRegion lock() {} {}", getInternalRegion().getCacheNamespace(), lock);
        evictAll();
    }
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
    }
765615
@Before
    public void setUp() {
        defineApplicationLocales();

        clearKeys();

        List<Key> keys = new ArrayList<>();
        keys.add(createKey(KEY_DEFAULT, false, false, false));

        Key outdatedKey = createKey(KEY_OUTDATED, false, false, false);
        outdatedKey.setOutdated();
        keys.add(outdatedKey);

        keys.add(createKey(KEY_TLN_APPROX, true, false, false));
        keys.add(createKey(KEY_TLN_OUTDATED, false, true, false));
        keys.add(createKey(KEY_TLN_MISSING, false, false, true));

        Key key = keyFactory.createKey(KEY_WITH_MISSING_TRANSLATION);
        key.addTranslation(FR, TRANSLATION_FR);
        keys.add(key);

        for (Key keyToPersist : keys) {
            keyRepository.add(keyToPersist);
        }
    }
406759
def apply_system_defaults
      if    @region.nil? && @zone.nil?
        @region, @zone = Rudy::DEFAULT_REGION, Rudy::DEFAULT_ZONE
      elsif @region.nil?
        @region = @zone.to_s.gsub(/[a-z]$/, '').to_sym
      elsif @zone.nil?
        @zone = "#{@region}b".to_sym
      end
      
      @environment ||= Rudy::DEFAULT_ENVIRONMENT
      @role ||= Rudy::DEFAULT_ROLE
      @localhost ||= Rudy.sysinfo.hostname || 'localhost'
      @auto = false if @auto.nil?
    end
1068805
protected function setSystemLocale()
    {
        $u = new User();
        $lan = $u->getUserLanguageToDisplay();
        $loc = Localization::getInstance();
        $loc->setContextLocale(Localization::CONTEXT_UI, $lan);
    }
1194159
public void addRegion(Region region) {
        if (!regions.contains(region)) {
            if (serviceConnected) {
                try {
                    beaconManager.startMonitoringBeaconsInRegion(region);
                } catch (RemoteException e) {
                    LogManager.e(e, TAG, "Can't add bootstrap region");
                }
            } else {
                LogManager.w(TAG, "Adding a region: service not yet Connected");
            }
            regions.add(region);
        }
    }
308267
@Override
	public void setup(AbstractInvokable parent) {
		@SuppressWarnings("unchecked")
		final GenericCollectorMap<IT, OT> mapper =
			RegularPactTask.instantiateUserCode(this.config, userCodeClassLoader, GenericCollectorMap.class);
		this.mapper = mapper;
		mapper.setRuntimeContext(getUdfRuntimeContext());
	}
1143395
public function setRegion( string $region ): self
	{
		$this->setSetting(self::SET_REGION, $this->regions->getRegionName($region));
		$this->setSetting(self::SET_PLATFORM, $this->platforms->getPlatformName($region));
		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