cache variable initializer
@param {String} key
@param {String} envKey
@param {Boolean} def
@returns {Boolean}
4329
function initVar (key, envKey, def) {
        var negate = !def;
        switch (true) {
            case cacheObj.hasOwnProperty(key):
                return cacheObj[key];
            case process.env.hasOwnProperty(envGlobalCacheKey):
                return process.env[envGlobalCacheKey] !== '';
            case process.env.hasOwnProperty(envKey):
                return negate ? process.env[envKey] === 'YES' : process.env[envKey] !== 'NO';
            default:
                return def;
        }
    }
596001
private <K, V> LoadingCache<K, V> cacheFor(Function<K, V> fn) {
        return CacheBuilder.newBuilder().build(new CacheLoader<K, V>() {
            @Override
            public V load(K key) {
                return fn.apply(key);
            }
        });
    }
652499
function updateVariable(key, value) {
            variableService.addOrUpdate({key: key, value: value}, function () {
                vm.variables[key] = value;
                vm.variable = {
                    key: undefined,
                    value: undefined
                };
            });
        }
118002
function envar(key)
{
  var i, value;

  // be extra paranoid
  if (typeof key != 'string' || !key) return undefined;

  // lookup according to the order
  for (i=0; i<state.order.length; i++)
  {
    if ((value = lookup[state.order[i]](key)) !== undefined)
    {
      return value;
    }
  }

  // nothing found
  return undefined;
}
116709
function cached (fn) {
  var cache = Object.create(null);
  return (function cachedFn (str) {
    var hit = cache[str];
    return hit || (cache[str] = fn(str))
  })
}
1134490
function memoify(fn, {hash, cache} = {}) {
  hash = hash || identify;
  cache = cache = {};
  function memoified(...args) {
    var key = hash(...args);
    return key in cache ? cache[key] : cache[key] = fn.call(this, ...args);
  }
  memoified.clear = () => cache = {};
  return memoified;
}
384313
function resolveVariable(identifier) {
            if (!resolvedVariableCache.has(identifier)) {
                const surroundingScope = getScope(identifier);

                if (surroundingScope) {
                    resolvedVariableCache.set(identifier, resolveVariableInScope(identifier, surroundingScope));
                } else {
                    resolvedVariableCache.set(identifier, null);
                }
            }

            return resolvedVariableCache.get(identifier);
        }
573411
function(keys){

  console.log('\nInitializing keys in Redis...\n')

  keys.forEach(function(el,i){

    client.get(el.key, function(e,d){

      if(e) {
        console.log("Error trying to get %s ", el.key)
        return console.error(e)
      }

      // checking for falsey values only is a bad idea
      if(typeof d === 'undefined'){

        console.log("Not OK trying to get %s ", el.key)

        client.set(el.key, el.initialValue, function(e,d){
          if(e) {
            console.log("Error trying to set %s ", el.key)
            return console.error(e)
          }
          if(d !== 'OK') {
            console.log("Not OK trying to set %s ", el.key)
            return console.warn(el.key + " was not set.")
          }
          if(d === 'OK') {
            console.log("OK setting %s ", el.key)
            client.get(el.key, function(e,d){
             console.log(d) 
            })
          }

        }) // end set.
      }

      console.log("The value for key %s is %s", el.key.yellow, d.green)

    }) // end get

  })
}
1093039
function defaults(target, defs) {
  if (target == null) target = {};
  var ret = {};
  var keys = Object.keys(defs);
  for (var i = 0, len = keys.length; i < len; i++) {
    var key = keys[i];
    ret[key] = target[key] || defs[key];
  }
  return ret;
}
878905
static function init(&$arr, $key, $default = null) 
    {
        if (! isset($arr[$key])) {
            $arr[$key] = $default;
        }
        return $arr[$key];
    }
1052552
function cacheFactory(internalCache) {

  // comparison cache will be use by getters
  //  since getters are persistent on the internal cache then the comparison cache also needs to be persistent
  var isTestedCache = {};

  /**
   * Get a pipeline 'deps' stage that populates cache for incremental compile.
   * Called on fully transformed row but only when there is no cache hit.
   * @param {object} depsCache The cache used by module-deps
   * @returns {stream.Through} a through stream
   */
  return function getCacheSession(depsCache) {

    // make getters for any existing values (cache is shared across instances)
    for (var key in internalCache) {
      defineGetterFor(depsCache, key);
    }

    // comparison cache needs to be reset every compile
    //  setting value is quicker than delete operation by an order of magnitude
    for (var key in isTestedCache) {
      isTestedCache[key] = false;
    }

    // deps stage transform
    function transform(row, encoding, done) {
      /* jshint validthis:true */
      var filename = row.file;
    
      var fileSource = null;
      try {
        fileSource = fs.readFileSync(filename).toString()
      } catch (e) {}

      if (fileSource !== null) {
        // populate the cache (overwrite)
        isTestedCache[filename] = false;
        internalCache[filename] = {
          input : fileSource,
          output: {
            id    : filename,
            source: row.source,
            deps  : merge({}, row.deps),
            file  : filename
          }
        };          
      }

      // ensure a getter is present for this key
      defineGetterFor(depsCache, filename);

      // complete
      this.push(row);
      done();
    }

    return through.obj(transform);
  };

  /**
   * Create getter on first appearance of a given key and operate through the persistent cache objects.
   * However be careful not to use any closed over variables in the getter.
   * @param {object} depsCache The browserify cache shared across instances
   * @param {string} filename The key (file name) for the deps cache
   */
  function defineGetterFor(depsCache, filename) {

    // instead of making the property re-definable we instead make assignment idempotent
    if (!depsCache.hasOwnProperty(filename)) {
      Object.defineProperty(depsCache, filename, {get: getter});
    }

    // create a getter
    //  we need to use a getter as it is the only hook at which we can perform comparison
    //  the value is accessed multiple times each compile cycle but is only set at the end of the cycle
    //  getters will persist for the life of the internal cache so the test cache also needs to persist
    function getter() {

      // not found
      var cached = internalCache[filename];
      if (!cached) {
        return undefined;
      }
      // we have already tested whether the cached value is valid and deleted it if not
      else if (isTestedCache[filename]) {
        return cached.output;
      }
      // test the input
      else {
        var isMatch = cached.input && fs.existsSync(filename) &&
          (cached.input === fs.readFileSync(filename).toString());
        isTestedCache[filename] = true;
        internalCache[filename] = isMatch && cached;
        return getter();
      }
    }
  }
}
1088970
function (key, val) {
    if (this._cache[key]) {
      return this._cache[key];
    }
    if (typeof val === 'function') {
      val = val.call(this);
    }
    return (this._cache[key] = val);
  }
304506
function(key, defaultValue){
    var c = getCache(this.ns)

    if(arguments.length === 0) {
      return c
    }

    return c[key] !== undefined ? c[key] : defaultValue
  }
220044
def cached(key, path_info, details, locals)
      name, prefix, partial = path_info

      if key
        @cache.cache(key, name, prefix, partial, locals) do
          yield
        end
      else
        yield
      end
    end
1358528
function _loadEnv(cwd) {
  const envPath = resolve(cwd, '.env');

  if (!process.env.SECRET_KEY && !fs.existsSync(envPath)) {
    Generator.copyEnv(cwd);
  }

  dotenv.config({ path: envPath });
}
1153849
def getvar(key, default=None, template='OPENSHIFT_{key}'):
    
    return os.environ.get(template.format(key=key), default)
549685
function(proto, key, def) {
		var desc;
		["getter", "setter"].forEach(function(name, set) {
			while (proto && proto[key] && !gui.Type.isDefined(def[name])) {
				proto = Object.getPrototypeOf(proto);
				desc = Object.getOwnPropertyDescriptor(proto, key);
				if (desc) {
					def[name] = desc[set ? "set" : "get"];
				}
			}
		});
		return {
			enumerable: true,
			configurable: true,
			get: def.getter || this._NOGETTER,
			set: def.setter || this._NOSETTER
		};
	}