Sets the variables to the selected stage using cap rbenv set
767
def set_vars_to_stage(stage, variables)
      # convert to array using VAR=value
      vars_array = variables.map{|k,v| "#{k}=#{v}" }
      Capistrano::Application.invoke(stage)
      Capistrano::Application.invoke("rbenv:vars:set", *vars_array)
    end
1355278
def with_env(self, **environment_variables):
        
        new_env_vars = {
            str(var): str(val) for var, val in environment_variables.items()
        }
        new_command = copy.deepcopy(self)
        new_command._env.update(new_env_vars)
        return new_command
388818
def setup_stage(name, options = {}, &block)
      stages[name] = ''

      if options.has_key?(:desc)
        stages[name] = options[:desc]
      end

      if name.to_s == get(:stage).to_s
        @loaded_stage = name

        instance_eval(&block)
      end
    end
75703
def set_config_from_envs(config):
    '''
    '''
    for section in config.sections():
        for token in config.options(section):
            set_config_token_from_env(section, token, config)
1192039
def _setup_versioned_lib_variables(env, **kw):
    

    tool = None
    try: tool = kw['tool']
    except KeyError: pass

    use_soname = False
    try: use_soname = kw['use_soname']
    except KeyError: pass

    # The $_SHLIBVERSIONFLAGS define extra commandline flags used when
    # building VERSIONED shared libraries. It's always set, but used only
    # when VERSIONED library is built (see __SHLIBVERSIONFLAGS in SCons/Defaults.py).
    if use_soname:
        # If the linker uses SONAME, then we need this little automata
        if tool == 'sunlink':
            env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS -h $_SHLIBSONAME'
            env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS -h $_LDMODULESONAME'
        else:
            env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS -Wl,-soname=$_SHLIBSONAME'
            env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS -Wl,-soname=$_LDMODULESONAME'
        env['_SHLIBSONAME'] = '${ShLibSonameGenerator(__env__,TARGET)}'
        env['_LDMODULESONAME'] = '${LdModSonameGenerator(__env__,TARGET)}'
        env['ShLibSonameGenerator'] = SCons.Tool.ShLibSonameGenerator
        env['LdModSonameGenerator'] = SCons.Tool.LdModSonameGenerator
    else:
        env['_SHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS'
        env['_LDMODULEVERSIONFLAGS'] = '$LDMODULEVERSIONFLAGS'

    # LDOMDULVERSIONFLAGS should always default to $SHLIBVERSIONFLAGS
    env['LDMODULEVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS'
741303
def set_env_vars(variables)
      save_vars = {}
      variables.each do |k, v|
        k = k.to_s
        save_vars[k] = ENV[k]
        ENV[k] = v.nil? ? v : v.to_s
      end
      begin
        yield
      ensure
        variables.each_key do |k|
          k = k.to_s
          ENV[k] = save_vars[k]
        end
      end
      true
    end
1117828
def _setup_environment(self, environments):
        """"""
        # If keepEnv is set or sudo is used, start from a fresh environment,
        # otherwise with the current one.
        # keepEnv specifies variables to copy from the current environment,
        # newEnv specifies variables to set to a new value,
        # additionalEnv specifies variables where some value should be appended, and
        # clearEnv specifies variables to delete.
        if self._user is not None or environments.get("keepEnv", None) is not None:
            run_environment = {}
        else:
            run_environment = os.environ.copy()
        for key, value in environments.get("keepEnv", {}).items():
            if key in os.environ:
                run_environment[key] = os.environ[key]
        for key, value in environments.get("newEnv", {}).items():
            run_environment[key] = value
        for key, value in environments.get("additionalEnv", {}).items():
            run_environment[key] = os.environ.get(key, "") + value
        for key in environments.get("clearEnv", {}).items():
            run_environment.pop(key, None)

        logging.debug("Using additional environment %s.", environments)
        return run_environment
1128564
def set_env_info(self, env_state=None, env_id=None, episode_id=None, bump_past=None, fps=None):
        
        with self.cv:
            if env_id is None:
                env_id = self._env_id
            if env_state is None:
                env_state = self._env_state
            if fps is None:
                fps = self._fps
            self.cv.notifyAll()

            old_episode_id = self._episode_id
            if self.primary:
                current_id = parse_episode_id(self._episode_id)
                # Bump when changing from resetting -> running
                if bump_past is not None:
                    bump_past_id = parse_episode_id(bump_past)
                    current_id = max(bump_past_id+1, current_id+1)
                elif env_state == 'resetting':
                    current_id += 1
                self._episode_id = generate_episode_id(current_id)
                assert self._fps or fps
            elif episode_id is False:
                # keep the same episode_id: this is just us proactive
                # setting the state to resetting after a done=True
                pass
            else:
                assert episode_id is not None, "No episode_id provided. This likely indicates a misbehaving server, which did not send an episode_id"
                self._episode_id = episode_id
            self._fps = fps
            logger.info('[%s] Changing env_state: %s (env_id=%s) -> %s (env_id=%s) (episode_id: %s->%s, fps=%s)', self.label, self._env_state, self._env_id, env_state, env_id, old_episode_id, self._episode_id, self._fps)
            self._env_state = env_state
            if env_id is not None:
                self._env_id = env_id

            return self.env_info()
1295861
def set_variable(var, val, override=false)

      fexp, v = locate_set_var(var, override) || locate_var(var)

      fexp.un_set_variable(:set, v, val, (fexp.h.fei != h.fei)) if fexp
    end
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'
1042559
public void setIgnoredEnvVars (final Set <String> aCollection)
  {
    ignoredEnvVars = new HashSet <> ();
    if (aCollection != null)
    {
      for (final String sName : aCollection)
        if (StringHelper.hasText (sName))
          if (!ignoredEnvVars.add (sName))
            getLog ().warn ("The ignored environment variable '" + sName + "' is contained more than once");
    }
  }
695485
def export_envars(self, env):
        """"""
        for k, v in env.items():
            self.export_envar(k, v)
1121876
public static function setEnvName($arg_env_name)
    {
        if($arg_env_name == 'stage'){
            self::$envName = 'stage';
            self::$domain = self::$domainStage;
        }elseif($arg_env_name == 'prod'){
            self::$envName = 'prod';
            self::$domain = self::$domainProd;
        }else{
            throw new \Exception('Invalid Environment Given',4046969);
        }
    }
53526
def setSystemVariable(self, remote, name, value):
        """"""
        if self.remotes[remote]['username'] and self.remotes[remote]['password']:
            LOG.debug(
                "ServerThread.setSystemVariable: Setting System variable via JSON-RPC")
            session = self.jsonRpcLogin(remote)
            if not session:
                return
            try:
                params = {"_session_id_": session,
                          "name": name, "value": value}
                if value is True or value is False:
                    params['value'] = int(value)
                    response = self._rpcfunctions.jsonRpcPost(
                        self.remotes[remote]['ip'], self.remotes[remote].get('jsonport', DEFAULT_JSONPORT), "SysVar.setBool", params)
                else:
                    response = self._rpcfunctions.jsonRpcPost(
                        self.remotes[remote]['ip'], self.remotes[remote].get('jsonport', DEFAULT_JSONPORT), "SysVar.setFloat", params)
                if response['error'] is None and response['result']:
                    res = response['result']
                    LOG.debug(
                        "ServerThread.setSystemVariable: Result while setting variable: %s" % str(res))
                else:
                    if response['error']:
                        LOG.debug("ServerThread.setSystemVariable: Error while setting variable: %s" % str(
                            response['error']))

                self.jsonRpcLogout(remote, session)
            except Exception as err:
                self.jsonRpcLogout(remote, session)
                LOG.warning(
                    "ServerThread.setSystemVariable: Exception: %s" % str(err))
        else:
            try:
                return self.proxies["%s-%s" % (self._interface_id, remote)].setSystemVariable(name, value)
            except Exception as err:
                LOG.debug(
                    "ServerThread.setSystemVariable: Exception: %s" % str(err))
560448
def update_environment_variables(self, filename):
        """"""
        self.env.update({'PIPELINE_BASH_FILE_ORIGINAL': filename})
        filename = os.path.join('/root/scripts', os.path.basename(filename))
        self.env.update({'PIPELINE_BASH_FILE': filename})

        # remove those keys for Docker since the paths inside Docker are different
        os_environ = os.environ.copy()
        for remove_variable in ['PATH', 'PYTHONPATH', 'JAVA_HOME', 'HOME']:
            os_environ.pop(remove_variable, None)

        self.env.update(os_environ)
860324
public static function setupGlobalVariables(): void
	{
		$_SERVER = array_intersect_key($_SERVER, array_flip([
			'PHP_SELF',
			'SCRIPT_NAME',
			'SERVER_ADDR',
			'SERVER_SOFTWARE',
			'HTTP_HOST',
			'DOCUMENT_ROOT',
			'OS',
			'argc',
			'argv',
		]));
		$_SERVER['REQUEST_TIME'] = 1234567890;
		$_ENV = $_GET = $_POST = [];
	}
74604
def set_environment_variable(self, key, val):
        
        if self.get_environment_variable(key) in [None, val]:
            self.__dict__['environment_variables'][key] = val
        else:
            raise Contradiction("Could not set environment variable %s" % (key))