If given environment key is defined, print it out.
198455
def print_env_info(key, out=sys.stderr):
    """"""
    value = os.getenv(key)
    if value is not None:
        print(key, "=", repr(value), file=out)
572806
def printer(self):
        """"""
        for key in self.statediag:
            if key.trans is not None and len(key.trans) > 0:
                print '****** ' + repr(key.id) + '(' + repr(key.type)\
                      + ' on sym ' + repr(key.sym) + ') ******'
                print key.trans
682347
public static void logShellEnvironmentVariables() {
		Map<String, String> env = System.getenv();
		Iterator<String> keys = env.keySet().iterator();
		while (keys.hasNext() ) {
			String key = keys.next();
			String value = env.get(key);
			logMessage("Env, "+key+"="+value.trim());
		}
	}
1156268
def _get_env(self, key):
        
        if self._env_key_replacer is not None:
            key = key.replace(*self._env_key_replacer)
        return os.getenv(key)
89505
def list_envs():
    """"""
    for env in lib.get_environments():
        margin_left = lib.get_margin(len(env['name']))
        print("{0}{1}{2}".format(
            env['name'], margin_left,
            env.get('description', '(no description)')))
788992
def env(key, default=None, required=False):
    
    try:
        value = os.environ[key]
        return ast.literal_eval(value)
    except (SyntaxError, ValueError):
        return value
    except KeyError:
        if default or not required:
            return default
        raise ImproperlyConfigured(
            "Missing required environment variable '%s'" % key)
1298667
def execution_environment():
    """"""
    context = {}
    context['conf'] = config()
    if relation_id():
        context['reltype'] = relation_type()
        context['relid'] = relation_id()
        context['rel'] = relation_get()
    context['unit'] = local_unit()
    context['rels'] = relations()
    context['env'] = os.environ
    return context
734031
String getEnvVar( String key)
	{
		String envVal = System.getenv(key);

		return envVal != null ? envVal : "";
	}
881305
def from_env(key: str, default: T = None) -> Union[str, Optional[T]]:
    
    return os.getenv(key, default)
19110
def _search_env(keys):
		
		matches = (os.environ[key] for key in keys if key in os.environ)
		return next(matches, None)
9467
def isatty_from_env(cls, env):
    
    def str_int_bool(i):
      return i.isdigit() and bool(int(i))  # Environment variable values should always be strings.

    return tuple(
      str_int_bool(env.get(cls.TTY_ENV_TMPL.format(fd_id), '0')) for fd_id in STDIO_DESCRIPTORS
    )
973179
def _check_environ(variable, value):
    """"""
    if is_not_none(value):
        return value
    else:
        value = os.environ.get(variable)
        if is_none(value):
            stop(''.join([variable,
                          """ not supplied and no entry in environmental
                           variables"""]))
        else:
            return value
1142632
def print_pretty_command(env, command):
    
    cmd = abbr_cmd = command[0]
    if cmd.startswith(env.envbindir):
        abbr_cmd = os.path.relpath(cmd, env.envbindir)
        if abbr_cmd == ".":
            # TODO are there more edge cases?
            abbr_cmd = cmd
    command[0] = abbr_cmd
    print('(%s)$ %s' % (env.name, ' '.join(['"%s"' % c if " " in c
                                            else c
                                            for c in command])))
    command[0] = cmd
    return abbr_cmd, cmd, command
98573
def generate_env(self):
        
        for key in sorted(list(self.spec.keys())):
            if self.spec[key]['type'] in (dict, list):
                value = f"\'{json.dumps(self.spec[key].get('example', ''))}\'"
            else:
                value = f"{self.spec[key].get('example', '')}"
            print(f"export {self.env_prefix}_{key.upper()}={value}")
1353910
def get_windows_env_var(key):
    

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

    buf = ctypes.create_unicode_buffer(32767)

    stored = winapi.GetEnvironmentVariableW(key, buf, 32767)
    if stored == 0:
        raise ctypes.WinError()
    return buf[:stored]
277706
def print_app_info (out=stderr):
    """"""
    print(_("System info:"), file=out)
    print(configuration.App, file=out)
    print(_("Released on:"), configuration.ReleaseDate, file=out)
    print(_("Python %(version)s on %(platform)s") %
                    {"version": sys.version, "platform": sys.platform}, file=out)
    for key in PYTHON_ENV_VARS:
        print_env_info(key, out=out)
    print(configuration.get_modules_info(), file=out)
    stime = strformat.strtime(time.time())
    print(_("Local time:"), stime, file=out)
    print(_("sys.argv:"), sys.argv, file=out)
1356422
def get(key, default=None):
    """"""
    val = os.environ.get(key, default)
    
    if val == 'True':
        val = True
    elif val == 'False':
        val = False
    return val