prints all environment variables for this process
16651
private static void printEnvVariables() {
    System.out.println("Environment Variables: ");
    Map<String,String> map = System.getenv();
    Set<String> keys = map.keySet();
    Iterator iter = keys.iterator();
    while(iter.hasNext()) {
      String thiskey = (String)(iter.next()); 
      String value = map.get(thiskey);
      System.out.println(thiskey + " = " + value);
    }
  }
480548
private static Properties getWindowsShellVariables()
        throws EnvironmentException
    {
        Properties properties = new Properties();
        // build the command based on the shell used: cmd.exe or command.com
        StringBuffer buffer = new StringBuffer( getWindowsUserShell() );
        buffer.append( " /C SET" );
        String cmdExec = buffer.toString();

        int exitValue = readEnvironment( cmdExec, properties );
        if( 0 != exitValue )
        {
            String message = "Environment process failed with non-zero exit code of " + exitValue;
            throw new EnvironmentException( message );
        }

        return properties;
    }
544519
def env(self):
        
        from copy import copy

        env = copy(self.doc.env)

        assert env is not None, 'Got a null execution context'

        env.update(self._envvar_env)

        env.update(self.all_props)

        return env
186346
def init(envVarName, enableColorOutput=False):
    
    global _initialized

    if _initialized:
        return

    global _ENV_VAR_NAME
    _ENV_VAR_NAME = envVarName

    if enableColorOutput:
        _preformatLevels(envVarName + "_NO_COLOR")
    else:
        _preformatLevels(None)

    if envVarName in os.environ:
        # install a log handler that uses the value of the environment var
        setDebug(os.environ[envVarName])
    addLimitedLogHandler(stderrHandler)

    _initialized = True
447599
def _get_env(self):
        
        env = {}
        for k, v in os.environ.items():
            k = k.decode() if isinstance(k, bytes) else k
            v = v.decode() if isinstance(v, bytes) else v
            env[k] = v
        return list(env.items())
1290413
def override_env_variables():
    """"""
    env_vars = ("LOGNAME", "USER", "LNAME", "USERNAME")
    old = [os.environ[v] if v in os.environ else None for v in env_vars]

    for v in env_vars:
        os.environ[v] = "test"
    yield

    for i, v in enumerate(env_vars):
        if old[i]:
            os.environ[v] = old[i]
765258
def show():
    """"""
    env = get_environment()

    for key, val in sorted(env.env.items(), key=lambda item: item[0]):
        click.secho('%s = %s' % (key, val))
883435
def generate_readme(self):
        
        print("## Examples of settings runtime params")
        print("### Command-line parameters")
        print("```")
        self.generate_command()
        print("```")
        print("###  Environment variables")
        print("```")
        self.generate_env()
        print("```")
        print("###  ini file")
        print("```")
        self.generate_ini()
        print("```")
        print("###  docker run")
        print("```")
        self.generate_docker_run()
        print("```")
        print("###  docker compose")
        print("```")
        self.generate_docker_compose()
        print("```")
        print("###  kubernetes")
        print("```")
        self.generate_kubernetes()
        print("```")
        print("###  drone plugin")
        print("```")
        self.generate_drone_plugin()
        print("```")
325781
def _serialiseEnv(self):
        
        # Dump out the environment of this process in the environment pickle file.
        with self._jobStore.writeSharedFileStream("environment.pickle") as fileHandle:
            pickle.dump(dict(os.environ), fileHandle, pickle.HIGHEST_PROTOCOL)
        logger.debug("Written the environment for the jobs to the environment file")
486411
public function printSummary() {
    drush_print();

    // Print env files used for this definition.
    drush_print($this->formatHeading('Environment Definitions Found'));
    foreach ($this->loadedEnvs as $filename) {
      drush_print("{$filename}", 1);
    }

    drush_print();
    drush_print($this->formatHeading(dt("CONFIGURATION SUMMARY")));

    // We want to make sure they are printed in the same order as they will run.
    foreach ($this->getActiveDefinition() as $group => $options) {
      // Print a nice heading.
      $heading = $this->formatHeading($group);

      switch (strtolower($group)) {
        case 'modules':
          $this->printModuleSummary($options, $heading);
          break;

        case 'variables':
          $this->printVariableSummary($options, $heading);
          break;

        case 'permissions':
          $this->printPermissionSummary($options, $heading);
          break;

        case 'commands':
          $this->printCommandSummary($options, $heading);
          break;

        default:
          drush_print($this->formatHeading($group));
          drush_log(dt("I'm not sure what to do with '@group'.", ['@group' => $group]), 'warning');
          break;
      }
    }
  }
661237
def set_os_environ(variables_mapping):
    
    for variable in variables_mapping:
        os.environ[variable] = variables_mapping[variable]
        logger.log_debug("Set OS environment variable: {}".format(variable))
1197533
private static void dumpOutDebugInfo() {

        LOG.info("Dump debug output");
        Map<String, String> envs = System.getenv();
        for (Map.Entry<String, String> env : envs.entrySet()) {
            LOG.info("System env: key=" + env.getKey() + ", val=" + env.getValue());
            System.out.println("System env: key=" + env.getKey() + ", val="
                    + env.getValue());
        }

        BufferedReader buf = null;
        try {
            String lines = Shell.WINDOWS ? Shell.execCommand("cmd", "/c", "dir") :
                    Shell.execCommand("ls", "-al");
            buf = new BufferedReader(new StringReader(lines));
            String line = "";
            while ((line = buf.readLine()) != null) {
                LOG.info("System CWD content: " + line);
                System.out.println("System CWD content: " + line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            org.apache.hadoop.io.IOUtils.cleanup(LOG, buf);
        }
    }
1165947
function checkEnv(tmp) {
      if(typeof tmp === 'string') {
        var up = tmp.toUpperCase();
        if(up.indexOf("$ENV:") !== -1) {
          var envVariable = tmp.substr(5).trim();
          if(typeof process.env[envVariable] === 'undefined') {
            console.error('Environment variable: %s is missing, in config file: %s', envVariable, self.path);
            return;
          }
          return process.env[envVariable];
        }
        if(up.indexOf('$ARGV:') !== -1) {
          var argName = tmp.substr(6).trim(),
            argVal = crux.argv(argName);
          if(!argVal) {
            console.error('Argv variable: %s is missing, in config file: %s', argName, self.path);
            return;
          }
          return argVal;
        }
        return;
      }
      if(typeof tmp === 'object' && tmp !== null) {
        if(tmp instanceof Array) {
          for(var i= 0, len = tmp.length; i < len; i++) {
            var replacedVar = checkEnv(tmp[i]);
            if(typeof replacedVar !== 'undefined') {
              tmp[i] = replacedVar;
            }
          }
          return;
        }
        for(var key in tmp) {
          var replacedVar = checkEnv(tmp[key]);
          if(typeof replacedVar !== 'undefined') {
            tmp[key] = replacedVar;
          }
        }
      }
    }
444768
def get_output(vcbat, args = None, env = None):
    """"""

    if env is None:
        # Create a blank environment, for use in launching the tools
        env = SCons.Environment.Environment(tools=[])

    # TODO:  This is a hard-coded list of the variables that (may) need
    # to be imported from os.environ[] for v[sc]*vars*.bat file
    # execution to work.  This list should really be either directly
    # controlled by vc.py, or else derived from the common_tools_var
    # settings in vs.py.
    vs_vc_vars = [
        'COMSPEC',
        # VS100 and VS110: Still set, but modern MSVC setup scripts will
        # discard these if registry has values.  However Intel compiler setup
        # script still requires these as of 2013/2014.
        'VS140COMNTOOLS',
        'VS120COMNTOOLS',
        'VS110COMNTOOLS',
        'VS100COMNTOOLS',
        'VS90COMNTOOLS',
        'VS80COMNTOOLS',
        'VS71COMNTOOLS',
        'VS70COMNTOOLS',
        'VS60COMNTOOLS',
    ]
    env['ENV'] = normalize_env(env['ENV'], vs_vc_vars, force=False)

    if args:
        debug("Calling '%s %s'" % (vcbat, args))
        popen = SCons.Action._subproc(env,
                                      '"%s" %s & set' % (vcbat, args),
                                      stdin='devnull',
                                      stdout=subprocess.PIPE,
                                      stderr=subprocess.PIPE)
    else:
        debug("Calling '%s'" % vcbat)
        popen = SCons.Action._subproc(env,
                                      '"%s" & set' % vcbat,
                                      stdin='devnull',
                                      stdout=subprocess.PIPE,
                                      stderr=subprocess.PIPE)

    # Use the .stdout and .stderr attributes directly because the
    # .communicate() method uses the threading module on Windows
    # and won't work under Pythons not built with threading.
    stdout = popen.stdout.read()
    stderr = popen.stderr.read()

    # Extra debug logic, uncomment if necessary
#     debug('get_output():stdout:%s'%stdout)
#     debug('get_output():stderr:%s'%stderr)

    if stderr:
        # TODO: find something better to do with stderr;
        # this at least prevents errors from getting swallowed.
        import sys
        sys.stderr.write(stderr)
    if popen.wait() != 0:
        raise IOError(stderr.decode("mbcs"))

    output = stdout.decode("mbcs")
    return output
1318382
def print_all_param_defaults():
    """"""
    print("_______________________________________________________________________________")
    print("")
    print("                           Parameter Default Values")
    print("")
    classes = descendents(Parameterized)
    classes.sort(key=lambda x:x.__name__)
    for c in classes:
        c.print_param_defaults()
    print("_______________________________________________________________________________")
1055424
function getSlateEnv() {
  const env = {};

  SLATE_ENV_VARS.forEach((key) => {
    env[key] = process.env[key];
  });

  return env;
}
950260
public static function getEnvironmentVariables() {
    $dir = shell_exec('pwd');
    $dir_parts = explode(DIRECTORY_SEPARATOR, $dir);
    $project = trim(array_pop($dir_parts));
    $client = trim(array_pop($dir_parts));
    $dir = $dir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'project' . DIRECTORY_SEPARATOR . $client . DIRECTORY_SEPARATOR . $project;
    $environment_file = file_get_contents($dir . DIRECTORY_SEPARATOR . 'environment.yml');
    if (!$environment_file) {
      throw new MissingEnvironmentConfigurationException("The environment configuration is missing, please contact your administrator.");
    }
    return new EnvironmentVariables(Yaml::parse($environment_file));
  }