Set the environment to the supplied values from an empty state.
168971
def hermetic_environment_as(**kwargs):
  """"""
  old_environment = os.environ.copy() if PY3 else _copy_and_decode_env(os.environ)
  _purge_env()
  try:
    with environment_as(**kwargs):
      yield
  finally:
    _purge_env()
    _restore_env(old_environment)
698502
public static void setState(ParseState state) {

    if (state == null) {
      System.err.println("Null state found");
      Environment.logInfo("Null state found");
    }

    persData.setProperty(state.filename, state.firstLine + SEPARATOR + state.offset);
  }
931816
def set_env(user, name, value=None):
    '''
    
    '''
    lst = list_tab(user)
    for env in lst['env']:
        if name == env['name']:
            if value != env['value']:
                rm_env(user, name)
                jret = set_env(user, name, value)
                if jret == 'new':
                    return 'updated'
                else:
                    return jret
            return 'present'
    env = {'name': name, 'value': value}
    lst['env'].append(env)
    comdat = _write_cron_lines(user, _render_tab(lst))
    if comdat['retcode']:
        # Failed to commit, return the error
        return comdat['stderr']
    return 'new'
445032
@SuppressWarnings("unchecked")
  public final E set(E value)
  {
    Thread thread = Thread.currentThread();
    ClassLoader loader = thread.getContextClassLoader();

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

        return (E) envLoader.setAttribute(_varName, value);
      }
    }

    return setGlobal(value);
  }
1081096
function setFromOpts(state, opts, key, defaultValue) {
	var optsVal = opts[key];

	if (optsVal) {
		state[key] = optsVal;
	} else {
		state[key] = defaultValue;
	}
}
210062
def env(*args, **kwargs):
    
    for arg in args:
        value = os.environ.get(arg, None)
        if value:
            return value
    return kwargs.get("default", "")
1296832
def set_windows_env_var(key, value):
    

    if not isinstance(key, text_type):
        raise TypeError("%r not of type %r" % (key, text_type))

    if not isinstance(value, text_type):
        raise TypeError("%r not of type %r" % (value, text_type))

    status = winapi.SetEnvironmentVariableW(key, value)
    if status == 0:
        raise ctypes.WinError()
1254553
def p_empty_statement(self, p):
        """"""
        p[0] = self.asttypes.EmptyStatement(p[1])
        p[0].setpos(p)
1196321
def set_env_value(obj, attribute, value):
    
    varname = get_env_key(obj, attribute)
    os.environ[varname] = value
    return varname
1270061
function setEnv(env) {
  home.initHomeDir();
  const envFile = path.join(home.getHomePath(), FILE_ENV);
  const envData = {
    env,
  };
  debug('set fie env data : %o', envData);
  debug('set fie to : %s', envFile);
  cacheEnv = null;
  fs.outputJsonSync(envFile, envData);
}
1322641
function set (dictionary) {
  for (var key in dictionary) {
    if (missing(key)) process.env[key] = dictionary[key]
  }
}
1290790
def _settings_from_env(self):
        """"""
        return {attr: self._val_from_env(env, attr)
                for env, attr in const.ENV_TO_ATTR.items()
                if env in os.environ}
23013
def set_state(self, state, *, index=0):
        """"""
        return self.set_values({
            ATTR_DEVICE_STATE: int(state)
        }, index=index)
557197
def set_env(self, key, value):
        
        os.environ[make_env_key(self.appname, key)] = str(value)  # must coerce to string
        self._registered_env_keys.add(key)
        self._clear_memoization()
85332
public void setDomainEnvironment() {
        systemProperties = System.getProperties();
        if (System.getProperty(SET_DOMAIN_ENVIRONMENT) != null) {
            logger.debug("Setting System environment properties to Security Domain values");
            for (int i = 0; i < ENVNAMES.length; i++) {
                setOrClearSystemProperties(ENVNAMES[i], domainProperties);
            }
        }
    }
439748
def env(self, **kw):
        '''
        
        '''
        self._original_env = kw
        if self._env is None:
            self._env = dict(os.environ)
        self._env.update({k: unicode(v) for k, v in kw.iteritems()})
        return self
955910
def _replace_envvar(s, _):
    """"""
    e = s.split(":")
    if len(e) > 3 or len(e) == 1 or e[0] != "env":
        raise ValueError()
    elif len(e) == 2:
        # Note: this can/should raise a KeyError (according to spec).
        return os.environ[e[1]]
    else:  # len(e) == 3
        return os.environ.get(e[1], e[2])