Determine if the response has already been cached
@param  {Object}  config the config option from the request
@return {Boolean} retrns true if cached, otherwise false
426191
function isCached(config) {
        var cache;
        var defaultCache = $cacheFactory.get('$http');
        var defaults = $httpProvider.defaults;

        // Choose the proper cache source. Borrowed from angular: $http service
        if ((config.cache || defaults.cache) && config.cache !== false &&
          (config.method === 'GET' || config.method === 'JSONP')) {
            cache = angular.isObject(config.cache) ? config.cache
              : angular.isObject(defaults.cache) ? defaults.cache
              : defaultCache;
        }

        var cached = cache !== undefined ?
          cache.get(config.url) !== undefined : false;

        if (config.cached !== undefined && cached !== config.cached) {
          return config.cached;
        }
        config.cached = cached;
        return cached;
      }
747545
function(...args) {
      const cacheKey = keySelector(...args);

      if (isValidCacheKey(cacheKey)) {
        let cacheResponse = cache.get(cacheKey);

        if (cacheResponse === undefined) {
          cacheResponse = selectorCreator(...funcs);
          cache.set(cacheKey, cacheResponse);
        }

        return cacheResponse(...args);
      }
      console.warn(
        `[re-reselect] Invalid cache key "${cacheKey}" has been returned by keySelector function.`
      );
      return undefined;
    }
574402
function isValidConfig(config) {
    return (config.root != null && config.root.length > 0) &&
            isNullOrFunction(config.directoryFilter) &&
            isNullOrFunction(config.filesFilter) &&
            isNullOrString(config.directoryFilterRegex) &&
            isNullOrString(config.filesFilterRegex);
}
1325850
final protected function hasConfigs($config = null)
    {
        if (null !== $config) {
            return array_key_exists($config, self::$_configs);
        }

        return count(self::$_configs) > 0;
    }
98119
function thinkCache(name, value, config) {
  assert(name && helper.isString(name), 'cache.name must be a string');
  if (config) {
    config = helper.parseAdapterConfig(this.config('cache'), config);
  } else {
    config = helper.parseAdapterConfig(this.config('cache'));
  }
  const Handle = config.handle;
  assert(helper.isFunction(Handle), 'cache.handle must be a function');
  delete config.handle;
  const instance = new Handle(config);
  // delete cache
  if (value === null) {
    return Promise.resolve(instance.delete(name));
  }
  // get cache
  if (value === undefined) {
    return debounceInstance.debounce(name, () => {
      return instance.get(name);
    });
  }

  // get cache when value is function
  if (helper.isFunction(value)) {
    return debounceInstance.debounce(name, () => {
      let cacheData;
      return instance.get(name).then(data => {
        if (data === undefined) {
          return value(name);
        }
        cacheData = data;
      }).then(data => {
        if (data !== undefined) {
          cacheData = data;
          return instance.set(name, data);
        }
      }).then(() => {
        return cacheData;
      });
    });
  }
  // set cache
  return Promise.resolve(instance.set(name, value));
}
1122688
public function check(array $config): bool
    {
        $this->notReachableServers = $this->parseConfiguredServers(Arr::get($config, 'servers', []));
        if ($this->notReachableServers->isEmpty()) {
            return true;
        }

        $this->notReachableServers = $this->notReachableServers->reject(function (Server $server) {
            $ping = new Ping($server->getHost());
            $ping->setPort($server->getPort());
            $ping->setTimeout($server->getTimeout());

            if ($ping->getPort() === null) {
                $latency = $ping->ping('exec');
            } else {
                $latency = $ping->ping('fsockopen');
            }

            return $latency !== false;
        });

        return $this->notReachableServers->isEmpty();
    }
781388
function has(key) {
    if (options.cacheValues) {
      return Promise.resolve((cachedData[key] !== undefined));
    } else if (options.cacheKeys) {
      return Promise.resolve((cachedKeys.indexOf(key) !== -1));
    } else {
      return readData().then(function(data) {
        return (data[key] !== undefined);
      });
    }
  }
1193772
function(key) {
      if (!cache) return null;
      var cached = cache.get(key);
      if (cached) console.log('cache hit: %s', key);
      return cached;
    }
1046622
private function isCacheUpToDate()
    {
        if (!file_exists($this->cachedFile)) {
            return false;
        }

        $cacheTime  = filemtime($this->cachedFile);
        $configTime = max(filemtime($this->configPath), filemtime($this->envFile));

        return $cacheTime == $configTime;
    }
1196686
def config_changed?(name)
      logger.debug "config_changed?(#{name.inspect})"
      name = name.to_s
      !(self.cache_files[name] === get_config_files(name))
    end
709357
function( config ) {
		
		for( var key in lm.config.itemDefaultConfig ) {
			if( config[ key ] === undefined ) {
				config[ key ] = lm.config.itemDefaultConfig[ key ];
			}
		}
		
		return config;
	}
1173515
public static function isCacheEnabled($pBlockConfig)
    {
    	$configCacheName = ConfigInterface::CONFIG_CACHE_NAME;

    	return (is_array($pBlockConfig)
    			and Agl::app()->isCacheEnabled()
    			and isset($pBlockConfig[$configCacheName])
    			and is_array($pBlockConfig[$configCacheName]));
    }
421158
private void cacheConfig(String oid, JsonSimpleConfig config) {
		if (useCache && config != null) {
			configCache.put(oid, config);
		}
	}
917050
private function checkConfig($config){
		$config = Hash::merge($this->configDef,$config);
		$this->include = $config['include'];
		unset($config['include']);
    	$this->config= $config;
	}
880316
function verifyConfig(config) {
  var i = 0;
  var required = ['logs', 'client_name', 'server_port'];
  var optional = {
    'server_host': '127.0.0.1'
  };

  for(i = 0; i < required.lenght; i++) {
    if(!config[required[i]]) {
      throw 'Config missing required: ' + required[i];
    }
  }

  for(i in optional) {
    if(optional.hasOwnProperty(i)) {
      if(!config[i]) {
        config[i] = optional[i];
      }
    }
  }

  return config;
}
1010106
function (config) {
    config = config || {};

    // Calling base constructor
    LifeCycle.call(this);

    /**
     * Appender config
     */
    this.name = config.name;

    /**
     * Underlying layout
     */
    this.layout = config.layout;

    /**
     * Appender filter
     */
    this.filter = config.filter;

    /**
     * Trace level
     */
    this.level = config.level || 'all';

    /**
     * Function used to determine whether a level is below the
     * trace level of the Appender
     */
    this.isBelow = config.isLogLevelBelow || function () {
      return true;
    };
  }
813292
function setupCache (config = {}) {
  // Extend default configuration
  config = makeConfig(config)

  // Axios adapter. Receives the axios request configuration as only parameter
  async function adapter (req) {
    // Merge the per-request config with the instance config.
    const reqConfig = mergeRequestConfig(config, req)

    // Execute request against local cache
    let res = await request(reqConfig, req)
    let next = res.next

    // Response is not function, something was in cache, return it
    if (!isFunction(next)) return next

    // Nothing in cache so we execute the default adapter or any given adapter
    // Will throw if the request has a status different than 2xx
    let networkError

    try {
      res = await reqConfig.adapter(req)
    } catch (err) {
      networkError = err
    }

    if (networkError) {
      // Check if we should attempt reading stale cache data
      let readOnError = isFunction(reqConfig.readOnError)
        ? reqConfig.readOnError(networkError, req)
        : reqConfig.readOnError

      if (readOnError) {
        try {
          // Force cache tu return stale data
          reqConfig.acceptStale = true

          // Try to read from cache again
          res = await request(reqConfig, req)

          // Signal that data is from stale cache
          res.next.request.stale = true

          // No need to check if `next` is a function just return cache data
          return res.next
        } catch (cacheReadError) {
          // Failed to read stale cache, do nothing here, just let the network error be thrown
        }
      }

      // Re-throw error so that it can be caught in userland if we didn't find any stale cache to read
      throw networkError
    }

    // Process response to store in cache
    return next(res)
  }

  // Return adapter and store instance
  return {
    adapter,
    config,
    store: config.store
  }
}