Cache a snippet or arbitrary value in memory.

@param  {String} `name` The snippet name
@param  {any} `val`
@return {Object} Returns the `Snippet` instance for chaining
@name .set
@api public
337853
function (name, val) {
    if (typeof name === 'object') {
      return this.visit('set', name);
    }
    utils.set(this.snippets, name, val);
    return this;
  }
256140
function (snippets, options) {
    if (typeof snippets === 'string') {
      var glob = lazy.glob();
      var files = glob.sync(snippets, options);
      files.forEach(function (fp) {
        var key = fp.split('.').join('\\.');
        this.set(key, {path: fp});
      }.bind(this));
    }
    return this;
  }
807457
function (key, val) {
      var entry = this._byKey.get(key);

      // reuse entry if the key exists
      if (entry) {
        this._touch(entry);
        entry.val = val;
        return;
      }

      entry = new Entry(key, val, this._head++);
      this._byKey.set(key, entry);
      this._byOrder[entry.index] = entry;
      this._len++;
      this._trim();
    }
1169246
function(name, value) {
    this.style[name] = value;
    this.eachCell(function(cell) {
      cell[name] = value;
    });
    return value;
  }
824344
function _cacheFunction(func, data, vars, relPath) {
  func.engine = this.className;
  if (vars) app.views.callbacks[relPath] = func;
}
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));
}
17589
function _cacheData(key, value) {
    cache[key] = { timeStamp: _getTimeStamp(), value: value };
    _deletePromiseWaiting(key);
    return value;
}
157936
def set(self, val, lifetime=None):
        
        cache.set(self.key,
                  (json.dumps(val) if self.serialize else val),
                  lifetime or settings.DEFAULT_CACHE_EXPIRE_TIME)
        return val
663059
def get_snippet(method_name, args_names, do_block, brace_block, scope)
      ERB.new(SublimeSunippetter::Templates::SUNIPPET_TEMPLATE).result(binding)
    end
258591
function(name) {
    name = name || '';

    var state = null;

    // Only use valid state queries
    if(!_validateStateName(name)) {
      return null;
    
    // Use cache if exists
    } else if(_stateCache[name]) {
      return _stateCache[name];
    }

    var nameChain = _getNameChain(name);
    var stateChain = nameChain
      .map(function(name, i) {
        var item = angular.copy(_stateLibrary[name]);
        return item;
      })
      .filter(function(parent) {
        return !!parent;
      });

    // Walk up checking inheritance
    for(var i=stateChain.length-1; i>=0; i--) {
      if(stateChain[i]) {
        var nextState = stateChain[i];
        state = angular.merge(nextState, state || {});
      }

      if(state && state.inherit === false) break;
    }

    // Store in cache
    _stateCache[name] = state;

    return state;
  }
1133665
function (name, preset) {
    if(typeof name !== 'string') {
      throw new TypeError('snippets#get expects `name` to be a string.');
    }
    if (utils.startsWith(name, './')) {
      return this.read(name);
    }

    // ex: `http(s)://api.github.com/...`
    if (/^\w+:\/\//.test(name) || preset) {
      var snippet = this.downloader
        .fetch(name, preset)
        .download();

      var parsed = url.parse(name);
      this.set(parsed.pathname, snippet);
      return new Snippet(snippet);
    }

    var res = this.snippets[name]
      || this.store.get(name)
      || utils.get(this.snippets, name);
    return new Snippet(res);
  }
641352
function(name, value, metaName) {
            if (_.isObject(name)) {
                _.each(name, function(value, name) {
                    this.meta(name, value);
                }, this);
                return;
            }

            if (metaName == null) metaName = "name";
            var mt = this.$('meta['+metaName+'="'+name+'"]');
            if (mt.length === 0) {
                mt =  $("<meta>", {}).attr(metaName, name).appendTo('head');
            }
            if (value != null) {
                mt.attr('content', value);
                return this;
            } else {
                return mt.attr('content');
            }
        }
687212
function (name,val) {
    if (this.findValue(name)) {
      var updateCookieVals = "";
      var cookieVals = $.cookie(this.cookieName).split("|");
      for (var i = 0; i < cookieVals.length; i++) {
        var fieldVals = cookieVals[i].split("~");
        if (fieldVals[0] == name) {
          fieldVals[1] = val;
        }
        updateCookieVals += (i > 0) ? "|"+fieldVals[0]+"~"+fieldVals[1] : fieldVals[0]+"~"+fieldVals[1];
      }
      $.cookie(this.cookieName,updateCookieVals);
    } else {
      this.addValue(name,val);
    }
  }
594942
function storage ( name, value ) {
        if (arguments.length == 0) {
            return;
        }
        if (arguments.length == 1) {
            let result = JSON.parse(localStorage.getItem(`${ namespace }.${ name }`));
            return result ? result.$ : result;
        }
        localStorage.setItem(`${ namespace }.${ name }`, JSON.stringify({ $ : value }));
        list[namespace][name] = '';
        localStorage.setItem(packageName, JSON.stringify(list));
        return value;
    }
581416
function memoize(fn, keyFn) {
  if (!keyFn) {
    keyFn = function keyFn() {
      if (arguments.length === 1) {
        return arguments[0];
      } else if (arguments.length === 0) {
        return 'undefined';
      }

      var args = [];

      for (var i = 0; i < arguments.length; i++) {
        args.push(arguments[i]);
      }

      return args.join('$');
    };
  }

  var memoizedFn = function memoizedFn() {
    var self = this;
    var args = arguments;
    var ret;
    var k = keyFn.apply(self, args);
    var cache = memoizedFn.cache;

    if (!(ret = cache[k])) {
      ret = cache[k] = fn.apply(self, args);
    }

    return ret;
  };

  memoizedFn.cache = {};
  return memoizedFn;
}
546932
public function prop(string $name, $val=null)
    {
        if ($val !== null) { // set attribute for all nodes
            foreach ($this->nodes as $node) {
                $node->$name = $val;
            }

            return $this;
        }
        // get property value for first element
        if ($name === 'outerHTML') {
            return $this->getOuterHtml();
        }
        if ($node = $this->getFirstElmNode()) {
            if (isset($node->$name)) {
                return $node->$name;
            }
        }
    }
291629
function (key, val) {
    var opts = lazy.clone(this.options);
    var View = this.get('View');
    val.path = val.path || key;
    key = val.key = this.renameKey(key);
    this.setItem(key, (this[key] = new View(val, opts)));
    return this;
  }