check if a variable is present in the environmental variables
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
545857
def env_or_default(var, default=None):
    
    if var in os.environ:
        return os.environ[var]
    return default
407736
function booleanEnvTrace(condition) {
    var conditionObj = parseCondition(condition);

    if (conditionObj.negate)
      return traceCondition(conditionalComplement(condition), false);
    else
      return traceCondition(condition, true);
  }
885202
def env(*_vars, **kwargs):
    
    for v in _vars:
        value = os.environ.get(v, None)
        if value:
            return value
    return kwargs.get('default', '')
313449
def _check_var(var, dtype, ndmin, name, shape=None, shape2=None):
    """
    if var is None:
        raise ValueError
    var = np.array(var, dtype=dtype, copy=True, ndmin=ndmin)
    if shape:
        _check_shape(var, name, shape, shape2)
    return var
1165253
private SemanticType checkVariable(Expr.VariableAccess expr, Environment environment) {
		Decl.Variable var = expr.getVariableDeclaration();
		return environment.getType(var);
	}
575456
def check_output(args, env=None, sp=subprocess):
    """"""
    log.debug('calling %s with env %s', args, env)
    output = sp.check_output(args=args, env=env)
    log.debug('output: %r', output)
    return output
750681
public function checkEnvironmentVariables()
    {
        $settingsValues = array();
        $iniSettings = array(
            'memory_limit', 'max_execution_time', 'upload_max_filesize'
        );

        foreach($iniSettings as $setting) {
            $settingsValues[$setting] = ini_get($setting);
        }

        return $settingsValues;
    }
263347
def _pass_variable(self):
        
        pass_var = []
        for var in os.environ.keys():
            expVAR = var.split("_")
            if expVAR[0] == self.prgnam.upper() and expVAR[1] != "PATH":
                pass_var.append("{0}={1}".format(expVAR[1], os.environ[var]))
        return pass_var
247755
function strFromEnvironmentVarSetting(functionsVar, envVar) {
  if (!process.env[envVar]) {
    const msg = `${envVar} does not exist on within environment variables`
    warn(msg)
    return ''
  }
  return `${functionsVar}="${process.env[envVar]}"`
}
410718
def _environment_sanity_check(environment):
    """"""
    assert issubclass(environment.undefined, Undefined), 'undefined must ' \
        'be a subclass of undefined because filters depend on it.'
    assert environment.block_start_string != \
        environment.variable_start_string != \
        environment.comment_start_string, 'block, variable and comment ' \
        'start strings must be different'
    assert environment.newline_sequence in ('\r', '\r\n', '\n'), \
        'newline_sequence set to unknown line ending string.'
    return environment
895663
function envReplace(str, vars) {
  return str.replace(/\$?\$\{([A-Za-z0-9_]+)(:-(.*?))?\}/g, function (varStr, varName, _, defValue) {
    // Handle escaping:
    if (varStr.indexOf('$$') === 0) {
      return varStr;
    }
    // Handle simple variable replacement:
    if (vars.hasOwnProperty(varName)) {
      log.debug(`${varName} replaced in configuration file`);
      return vars[varName];
    }
    // Handle default values:
    if (defValue) {
      log.debug(`${varName} replaced with default value in configuration file`);
      return defValue;
    }
    log.warn(`Unknown variable: ${varName}. Returning null.`);
    return null;
  });
}
845024
def get_env(name, default=None):
    """"""
    if name in os.environ:
        return os.environ[name]

    if default is not None:
        return default

    error_msg = "Set the {} env variable".format(name)
    raise ImproperlyConfigured(error_msg)
264636
public static function check()
    {
        if (Session::has(self::ENVIRONMENT_NAME)) {
            return true;
        }

        Session::forget(self::ENVIRONMENT_NAME);
        return false;
    }
511219
def get_optional_env(key):
    
    environment_variable_value = os.environ.get(key)
    if environment_variable_value:
        return environment_variable_value
    elif key in CONSTANTS:
        return CONSTANTS[key]
    else:
        raise Exception("The variable {1} is not set".format(key))
10774
def getenv(option, default=undefined, cast=undefined):
    

    # We can't avoid __contains__ because value may be empty.
    if option in os.environ:
        value = os.environ[option]
    else:
        if isinstance(default, Undefined):
            raise UndefinedValueError('{} not found. Declare it as envvar or define a default value.'.format(option))

        value = default

    if isinstance(cast, Undefined):
        return value

    if cast is bool:
        value = _cast_boolean(value)
    elif cast is list:
        value = [x for x in value.split(',') if x]
    else:
        value = cast(value)

    return value
118147
def check_environment(self, environment):
        

        non_strings = []
        for (k,v) in environment.items():
            if not isinstance(v, basestring):
                non_strings.append(k)
        if non_strings:
            raise ValueError("The following environment variables are not strings: {}".format(", ".join(non_strings)))
        else:
            return True