Return default list of env variables with their assigned value, if any.
431015
function _getFileContents(values) {
  const env = getDefaultSlateEnv();

  for (const key in values) {
    if (values.hasOwnProperty(key) && env.hasOwnProperty(key)) {
      env[key] = values[key];
    }
  }

  return Object.entries(env)
    .map((keyValues) => {
      return `${keyValues.join('=')}\r\n`;
    })
    .join('\r\n\r\n');
}
406869
def get_default_envlist(version):
    
    if version in ['pypy', 'pypy3']:
        return version

    # Assume single digit major and minor versions
    match = re.match(r'^(\d)\.(\d)(?:\.\d+)?$', version or '')
    if match:
        major, minor = match.groups()
        return 'py{major}{minor}'.format(major=major, minor=minor)

    return guess_python_env()
980396
def get_environment_var(varstr):
    """"""
    mo=_get_env_var.match(to_String(varstr))
    if mo:
        var = mo.group(1)
        if var[0] == '{':
            return var[1:-1]
        else:
            return var
    else:
        return None
1101735
def defaults(values={}):
    """"""
    if values: return values
    save_types = basestring, int, float, tuple, list, dict, type(None)
    for k, v in globals().items():
        if isinstance(v, save_types) and not k.startswith("_"): values[k] = v
    return values
65097
def get_list(key, *default, **kwargs):
    """"""
    separator = kwargs.get('separator', ' ')
    return get_env(key, *default, coerce=lambda x: x.split(separator))
1071405
def _optional_envs():
    
    envs = {
        key: os.environ.get(key)
        for key in OPTIONAL_ENV_VARS
        if key in os.environ
    }

    # If we're using Jenkins, check that we have all the required info
    if 'JOB_NAME' in envs and 'BUILD_NUMBER' not in envs:
        raise BrowserConfigError("Missing BUILD_NUMBER environment var")

    if 'BUILD_NUMBER' in envs and 'JOB_NAME' not in envs:
        raise BrowserConfigError("Missing JOB_NAME environment var")

    return envs
808535
def _with_env(self, env):
        """"""
        res = self._browse(env, self._ids)
        return res
1103750
def get_default_env(self):
        
        return dict_diff(
            old=ansible_mitogen.process.MuxProcess.original_env,
            new=os.environ,
        )
779783
def _get_environ_vars(self):
        # type: () -> Iterable[Tuple[str, str]]
        """"""
        for key, val in os.environ.items():
            should_be_yielded = (
                key.startswith("PIP_") and
                key[4:].lower() not in self._ignore_env_names
            )
            if should_be_yielded:
                yield key[4:].lower(), val
460611
def get_default(name, value):
    """"""
    return os.environ.get('EXAMPLE_{}'.format(name.upper()), value)
1174577
def find_missing_env(self):
        """"""
        missing = []
        for e in self.env:
            if e.default_val is None and e.set_val is None:
                if e.env_name not in os.environ:
                    missing.append(e.env_name)

        if missing:
            raise BadOption("Some environment variables aren't in the current environment", missing=missing)
821478
def _get_envs(self):
        '''
        
        '''
        envs = set(['base'])
        if 'pillar_roots' in self.opts:
            envs.update(list(self.opts['pillar_roots']))
        return envs
300891
def file_envs(self, load=None):
        '''
        
        '''
        if load is None:
            load = {}
        load.pop('cmd', None)
        return self.envs(**load)
943232
def _get_envs(self):
        '''
        
        '''
        envs = ['base']
        if 'file_roots' in self.opts:
            envs.extend([x for x in list(self.opts['file_roots'])
                         if x not in envs])
        env_order = self.opts.get('env_order', [])
        # Remove duplicates while preserving the order
        members = set()
        env_order = [env for env in env_order if not (env in members or members.add(env))]
        client_envs = self.client.envs()
        if env_order and client_envs:
            return [env for env in env_order if env in client_envs]

        elif env_order:
            return env_order
        else:
            envs.extend([env for env in client_envs if env not in envs])
            return envs
960661
def envget(var, default=None):
    """"""

    if 'pyraf' in sys.modules:
        #ONLY if pyraf is already loaded, import iraf into the namespace
        from pyraf import iraf
    else:
        # else set iraf to None so it knows to not use iraf's environment
        iraf = None

    try:
        if iraf:
            return iraf.envget(var)
        else:
            raise KeyError
    except KeyError:
        try:
            return _varDict[var]
        except KeyError:
            try:
                return os.environ[var]
            except KeyError:
                if default is not None:
                    return default
                elif var == 'TERM':
                    # Return a default value for TERM
                    # TERM gets caught as it is found in the default
                    # login.cl file setup by IRAF.
                    print("Using default TERM value for session.")
                    return 'xterm'
                else:
                    raise KeyError("Undefined environment variable `%s'" % var)
832463
def get_defaults(self):
        """"""
        # dont need 'required' to determine the default
        options = [copy.copy(opt) for opt in self._options]
        for opt in options:
            try:
                del opt.kwargs['required']
            except KeyError:
                pass
        parser = self.build_parser(options, permissive=True, add_help=False)
        parsed, _ = parser.parse_known_args([])
        return vars(parsed)
843947
def detect_envlist(ini):
    """"""
    # Find the envs that tox knows about
    declared_envs = get_declared_envs(ini)

    # Find all the envs for all the desired factors given
    desired_factors = get_desired_factors(ini)

    # Reduce desired factors
    desired_envs = ['-'.join(env) for env in product(*desired_factors)]

    # Find matching envs
    return match_envs(declared_envs, desired_envs,
                      passthru=len(desired_factors) == 1)