env/version 默认是应用整合设置的，但用户可以在配置中更改它
962745
protected static DisConfCommonModel makeDisConfCommonModel(String app, String env, String version) {

        DisConfCommonModel disConfCommonModel = new DisConfCommonModel();

        // app
        if (!app.isEmpty()) {
            disConfCommonModel.setApp(app);
        } else {
            disConfCommonModel.setApp(DisClientConfig.getInstance().APP);
        }

        // env
        if (!env.isEmpty()) {
            disConfCommonModel.setEnv(env);
        } else {
            disConfCommonModel.setEnv(DisClientConfig.getInstance().ENV);
        }

        // version
        if (!version.isEmpty()) {
            disConfCommonModel.setVersion(version);
        } else {
            disConfCommonModel.setVersion(DisClientConfig.getInstance().VERSION);
        }

        return disConfCommonModel;
    }
808535
def _with_env(self, env):
        """"""
        res = self._browse(env, self._ids)
        return res
1255811
function resolveEnvSources(env) {
  let paths = [];

  if (process.env[env]) {
    paths = process.env[env].includes(path.delimiter) ? process.env[env].split(path.delimiter) : [process.env[env]];
  }

  return paths;
}
70219
def get_env():
    
    if not __ENV__:
        env = os.environ["env"] if "env" in os.environ else "Dev"
        set_env(env)
    return __ENV__
1276495
def generate(env):
    """"""
    path, _cc, version = get_xlc(env)
    if path and _cc:
        _cc = os.path.join(path, _cc)

    if 'CC' not in env:
        env['CC'] = _cc

    cc.generate(env)

    if version:
        env['CCVERSION'] = version
654927
function mergeEnv(opts, env) {
    //用环境变量替换当前配置
    for (var i in env) {
        //console.log("", i);
        if (i.startsWith('pomjs_')) {

            var config = i.substring(6);
            if (config.indexOf('_') == -1) {
                opts[config] = env[i];
            } else {
                var temp = 'opts';
                var vs = config.split('_');
                for (var index = 0; index < vs.length; index++) {
                    temp += '.' + vs[index];
                    //console.log(temp, eval(temp));
                    if (!eval(temp) || index === vs.length - 1) {
                        var tempValue = index < vs.length - 1 ? '{}' : "'" + env[i] + "'";
                        eval(temp + '=' + tempValue);
                    }
                }
            }
        }
    }

    console.log(opts.saluki);
}
686108
def clean_env(uchroot_cmd, varnames):
    """"""
    env = uchroot_cmd["/usr/bin/env"]
    __clean_env = env["-u", ",".join(varnames)]
    return __clean_env
223701
function applyEnv(env, secrets = {}, required = {}) {
  if (Array.isArray(env)) {
    env.forEach(key => {
      // if the key already exists don't overwrite it
      if (!process.env[key]) {
        const value = getValue(key, {}, secrets, required)
        process.env[key] = value
      }
    })
  } else {
    Object.entries(env).forEach(([key, value]) => {
      // if the key already exists don't overwrite it
      if (!process.env[key]) {
        const value = getValue(key, env, secrets, required)
        process.env[key] = value
      }
    })
  }
}
846094
function restoreEnv(origEnv) {
  var key;
  for (key in origEnv) {
    if (origEnv[key][0]) {
      process.env[key] = origEnv[key][1];
    } else {
      delete process.env[key];
    }
  }
  return;
}
1346950
def env(xrdb_file=None, tty_reload=True):
    """"""
    xrdb(xrdb_file)
    i3()
    bspwm()
    kitty()
    sway()
    polybar()
    logging.info("Reloaded environment.")
    tty(tty_reload)
1371708
def get_impl_ver(env):
    """"""
    impl_ver = env.config_var("py_version_nodot")
    if not impl_ver or get_abbr_impl(env) == "pp":
        impl_ver = "".join(map(str, get_impl_version_info(env)))

    return impl_ver
887113
def __get_env_handle(self, root_dir):
        
        env_path = os.path.join(root_dir, '.env')
        gui_path = os.path.join(root_dir, '.gui')
        fh = open(env_path, "w+")
        # .env will source utils.sh if it hasn't already
        fh.write(source_template % (gui_path, gui_path))
        fh.write(source_template % (self.shell_util_path,
                                    self.shell_util_path))
        return (env_path, fh)
1150390
def change_env(name, val):
    
    oldval = os.environ.get(name, None)
    os.environ[name] = val
    yield
    if oldval is None:
        del os.environ[name]
    else:
        os.environ[name] = oldval
651367
function getEnv(key) {
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
}
165779
def patch_env(env, path, value):
        
        def pathGet(dictionary, path):
            for item in path.split("/"):
                dictionary = dictionary[item]
            return dictionary

        def pathSet(dictionary, path, value):
            path = path.split("/")
            key = path[-1]
            dictionary = pathGet(dictionary, "/".join(path[:-1]))
            dictionary[key] = value

        pathSet(env, path, value)
        return True
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;
          }
        }
      }
    }
848541
def get_env(env_file='.env'):
    
    try:
        with open(env_file) as f:
            for line in f.readlines():
                try:
                    key, val = line.split('=', maxsplit=1)
                    os.environ.setdefault(key.strip(), val.strip())
                except ValueError:
                    pass
    except FileNotFoundError:
        pass