Gets a particular sub-Environments of the context, raises error if it's not of type Environment.
@returns Environment object.
@public
488594
function GetSubEnvironment (subEnvironmentName) {
  let e = GetSubEnvironments()[subEnvironmentName]
  if (!e) {
    throw new Error('SubEnvironment does not exist.')
  }
  if (!(e instanceof ent.Environment)) {
    throw new Error('SubEnvironment is invalid.')
  }
  return e
}
1061040
public function getCurrentEnvironmentName()
    {
        if (!empty($this->currentEnvironmentName)) {
            return $this->currentEnvironmentName;
        }

        // get current environments
        $environments = $this->applicationConfig->get('Application.Environments', false);

        if($environments){
            // get current url
            $currentUrl = $this->str($this->httpRequest()->getCurrentUrl());

            // loop over all registered environments in the config, and try to match the current based on the domain
            foreach ($environments as $eName => $e) {
                if ($currentUrl->contains($e->Domain)) {
                    $this->currentEnvironmentName = $eName;
                }
            }
        }

        if (empty($this->currentEnvironmentName)) {
            $this->currentEnvironmentName = 'Production';
        }

        return $this->currentEnvironmentName;
    }
517483
def get_environment(self):
        '''
        
        '''
        env = {}
        if self.http:
            env['http_proxy'] = env['HTTP_PROXY'] = self.http
        if self.https:
            env['https_proxy'] = env['HTTPS_PROXY'] = self.https
        if self.ftp:
            env['ftp_proxy'] = env['FTP_PROXY'] = self.ftp
        if self.no_proxy:
            env['no_proxy'] = env['NO_PROXY'] = self.no_proxy
        return env
1101360
public Collection<Environment> environments(EnvironmentFilter filter) {
        return get(Environment.class, (filter != null) ? filter : new EnvironmentFilter());
    }
688566
def get_spontaneous_environment(*args):
    
    try:
        env = _spontaneous_environments.get(args)
    except TypeError:
        return Environment(*args)
    if env is not None:
        return env
    _spontaneous_environments[args] = env = Environment(*args)
    env.shared = True
    return env
724247
@SuppressWarnings("unchecked")
  public E get()
  {
    Thread thread = Thread.currentThread();
    ClassLoader loader = thread.getContextClassLoader();

    Object value = null;

    for (; loader != null; loader = loader.getParent()) {
      if (loader instanceof EnvironmentClassLoader) {
        EnvironmentClassLoader envLoader = (EnvironmentClassLoader) loader;

        value = envLoader.getAttribute(_varName);

        if (value != null)
          return (E) value;
      }
    }

    return _globalValue;
  }
1295883
def get_environments():
    
    config = ConfigParser.SafeConfigParser()

    config = _config_file()

    juicer.utils.Log.log_debug("Reading environment sections:")

    environments = config.sections()
    juicer.utils.Log.log_debug("Read environment sections: %s", ', '.join(environments))
    return environments
386568
private Environment switchEnvironment(Environment env) {
    Environment prev = currentEnvironment;
    currentEnvironment = env;
    return prev;
  }
543593
public static RpcInternalContext getContext() {
        RpcInternalContext context = LOCAL.get();
        if (context == null) {
            context = new RpcInternalContext();
            LOCAL.set(context);
        }
        return context;
    }
534319
public function getEnvironment()
	{
		$environment_file = $this->resolvePath('config/environment');
		
		if (file_exists($environment_file)) {
			$environment = trim(file_get_contents($environment_file));
		} else {
			$environment = 'local';
		}
		
		return $environment;
	}
65669
public function getEnvironments()
    {
        if (isset($this->values['environments'])) {
            $environments = [];
            foreach ($this->values['environments'] as $key => $value) {
                if (is_array($value)) {
                    $environments[$key] = $value;
                }
            }

            return $environments;
        }

        return null;
    }
1213211
protected function getEnvironments() {
        if (!$this->_environments) {
            $this->_environments = new EnvironmentList($this->version, $this->solution['sid']);
        }

        return $this->_environments;
    }
310097
public function getEnvironment()
    {
        if ($this->environment == null) {
            $this->setEnvironment($this->getRevision()->getEnvironment());
        }
        return $this->environment;
    }
486786
public function environment()
	{
		if (func_num_args() > 0)
		{
			$patterns = is_array(func_get_arg(0)) ? func_get_arg(0) : func_get_args();

			foreach ($patterns as $pattern)
			{
				if (str_is($pattern, $this['env']))
				{
					return true;
				}
			}

			return false;
		}

		return $this['env'];
	}
775974
public static function getRemoteEnvironments()
    {
        $environments = [];

        foreach (self::getProjectConfig()->getRemote() as $remote) {
            foreach ($remote as $environment) {
                if (!isset($environment['realm'])) {
                    continue;
                }
                $realm = $environment['realm'];
                unset($environment['realm']);

                $environments[$realm][] = $environment;
            }
        }

        return $environments;
    }
1317065
public function environment()
    {
        if ($this->environment) {
            return $this->environment;
        }

        if (!$this->environmentProvider) {
            $this->environment = static::PRODUCTION;
            return $this->environment;
        }

        $this->setEnvironment(call_user_func($this->environmentProvider, $this));

        return $this->environment;
    }
1312844
public static CompilerEnvirons ideEnvirons() {
        CompilerEnvirons env = new CompilerEnvirons();
        env.setRecoverFromErrors(true);
        env.setRecordingComments(true);
        env.setStrictMode(true);
        env.setWarnTrailingComma(true);
        env.setLanguageVersion(170);
        env.setReservedKeywordAsIdentifier(true);
        env.setIdeMode(true);
        env.setErrorReporter(new ErrorCollector());
        return env;
    }