List environment variables for an app
176518
function list(appName, callback) {
    var uri = format('/%s/apps/%s/config/', deis.version, appName);
    commons.get(uri, function onListResponse(err, result) {
      callback(err, result ? result.values : null);
    });
  }
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())
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);
    }
  }
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;
}
807234
def set_as_environment_variables(self, override=False):
        
        for k, v in self.dict().items():
            if k in os.environ and not override:
                continue
            # With Python2 on Windows, force environment variables to str to avoid
            # "TypeError: environment can only contain strings" in Python's subprocess.py.
            if PY2 and WIN:
                if isinstance(k, text_type) or isinstance(v, text_type):
                    k = k.encode('ascii')
                    v = v.encode('ascii')
            os.environ[k] = v

        return True
588437
def init_app(self, app):
        """"""
        prefix_len = len(self.prefix)
        for varname, value in os.environ.items():
            if not varname.startswith(self.prefix):
                continue

            # Prepare values
            varname = varname[prefix_len:]
            value = value or app.config.get(varname)

            # Evaluate value
            try:
                value = ast.literal_eval(value)
            except (SyntaxError, ValueError):
                pass

            # Set value
            app.config[varname] = value
894966
def _load_environment_vars(self):
        # type: () -> None
        
        self._config[kinds.ENV_VAR].update(
            self._normalized_keys(":env:", self._get_environ_vars())
        )
545590
def env_vars(self):
        """"""
        if not self.no_libfaketime:
            faketime_filename = self.service_group.hitch_dir.faketime()

            env_vars = dict(os.environ)
            env_vars.update(self._env_vars)
            env_vars.update(faketime.get_environment_vars(faketime_filename))
        else:
            env_vars = dict(os.environ)
            env_vars.update(self._env_vars)
        return env_vars
1363208
def environment(variables)
      before do
        variables.each do |key, value|
          if value.nil?
            _environment.delete(key.to_s)
          else
            _environment[key.to_s] = value.to_s
          end
        end
      end
    end
1358722
def load_dotenvs():
    
    if not os.getenv('DOTENVS_LOADED'):
        envs = ['.env', '.flaskenv']
        for env in envs:
            path = os.path.join(os.getcwd(), env)
            if os.path.isfile(path):
                dotenvs(path)
        os.environ['DOTENVS_LOADED'] = 'yes'
1229520
def list_app_resources(
        app, env, resources, cmdb, start, end, tz):
    """"""
    logging.basicConfig(level=logging.INFO)
    start, end = get_dates(start, end, tz)

    all_resources = []
    for rtype_name in resources:
        rtype = Resource.get_type(rtype_name)
        resources = rtype.get_resources(cmdb, start, end, app, env)
        all_resources.extend(resources)
    print(json.dumps(all_resources, indent=2))
574253
def get_current_environ():
    """"""
    thread_local = AutomatedLoggingMiddleware.thread_local
    if hasattr(thread_local, 'request_uri'):
        request_uri = thread_local.request_uri
    else:
        request_uri = None

    if hasattr(thread_local, 'application'):
        application = thread_local.application
        application = Application.objects.get_or_create(name=application)[0]
    else:
        application = None

    if hasattr(thread_local, 'method'):
        method = thread_local.method
    else:
        method = None

    if hasattr(thread_local, 'status'):
        status = thread_local.status
    else:
        status = None

    return request_uri, application, method, status
77231
def list_env(saltenv='base'):
    '''
    
    '''
    ret = {}
    if saltenv not in __opts__['pillar_roots']:
        return ret
    for f_root in __opts__['pillar_roots'][saltenv]:
        ret[f_root] = {}
        for root, dirs, files in salt.utils.path.os_walk(f_root):
            sub = ret[f_root]
            if root != f_root:
                # grab subroot ref
                sroot = root
                above = []
                # Populate the above dict
                while not os.path.samefile(sroot, f_root):
                    base = os.path.basename(sroot)
                    if base:
                        above.insert(0, base)
                    sroot = os.path.dirname(sroot)
                for aroot in above:
                    sub = sub[aroot]
            for dir_ in dirs:
                sub[dir_] = {}
            for fn_ in files:
                sub[fn_] = 'f'
    return ret
893350
def cmd_list(unused_conf: Config):
    """"""
    for name, builder in sorted(Plugin.builders.items()):
        if builder.func:
            print('+- {0:16s} implemented in {1.__module__}.{1.__name__}()'
                  .format(name, builder.func))
        else:
            print('+- {0:16s} loaded with no builder function'.format(name))
        for hook_name, hook_func in sorted(Plugin.get_hooks_for_builder(name)):
            print('  +- {0} hook implemented in '
                  '{1.__module__}.{1.__name__}()'
                  .format(hook_name, hook_func))
1371526
private function findEnvironments() {
    drush_log(dt('Loading environment files.'), 'debug');

    foreach ($this->configPaths as $path) {
      drush_log(dt("Scanning !path.", ['!path' => $path]), 'debug');
      foreach (drush_scan_directory($path, '/env\.drushrc\.y(a)?ml/') as $file) {
        $this->loadEnvFile($file);
      }
    }

    drush_log(dt('Loaded environment files.'), 'debug');
  }
552164
def get_environment_vars(filename):
    """"""
    if sys.platform == "linux" or sys.platform == "linux2":
        return {
            'LD_PRELOAD': path.join(LIBFAKETIME_DIR, "libfaketime.so.1"),
            'FAKETIME_SKIP_CMDS': 'nodejs',     # node doesn't seem to work in the current version.
            'FAKETIME_TIMESTAMP_FILE': filename,
        }
    elif sys.platform == "darwin":
        return {
            'DYLD_INSERT_LIBRARIES': path.join(LIBFAKETIME_DIR, "libfaketime.1.dylib"),
            'DYLD_FORCE_FLAT_NAMESPACE': '1',
            'FAKETIME_TIMESTAMP_FILE': filename,
        }
    else:
        raise RuntimeError("libfaketime does not support '{}' platform".format(sys.platform))
1348807
def get_env_variable(var_name, default=None):
    """"""
    try:
        return os.environ[var_name]
    except KeyError:
        if default is None:
            error_msg = "Set the %s environment variable" % var_name
            raise ImproperlyConfigured(error_msg)
        else:
            return default