Constructs a new Keychain
- [attrs] {object} : Load items
480012
function Keychain (attrs) {
  this.profileName = 'default';
  this.items = {};
  this.unlocked = false;
  this.event = new EventEmitter();

  if (attrs) {
    _.assign(this, attrs);
  }
}
1282796
def load
      parsed = JSON.parse(File.read(SPECPATH))
      structs = StructureContainer.new(parsed['PropertyTypes'])

      parsed['ResourceTypes'].each do |key, spec|
        match = key.match(/\A(\w+)::(\w+)::(\w+)\z/)

        register(match[1], match[2], match[3], spec, structs.search(key))
      end
    end
399791
def load(attributes)
      raise ArgumentError, "expected an attributes Hash, got #{attributes.inspect}" unless attributes.is_a?(Hash)
      @prefix_options, attributes = split_options(attributes)
      attributes.each do |key, value|
        @attributes[key.to_s] = typecast_attribute_value(key, value)
      end
      self
    end
293339
def load(key, options = {})
      return super if options.include?(:raw)
      value, expires = load_entry(key, options)
      value
    end
298732
function (key, value) {
    var Item = this.get('Item');

    if (!(value instanceof Item)) {
      value = new Item(value);
    }

    value.key = value.key || key;
    var i = this.indexOf(key);

    if (i !== -1) {
      this.items[i] = value;
    } else {
      this.items.push(value);
      this.keyMap[key] = this.items.length - 1;
    }

    this.emit('item', key, value);
    return this;
  }
943094
def new(self, **dict):
        ''''''
        if not self._item_new_path:
            raise AttributeError('new is not available for %s' % self._item_name)

        # Remap various tag to tag_id
        for tag in self._object._remap_to_id:
            self._object._remap_tag_to_tag_id(tag, dict)

        target = self._item_new_path
        payload = json.dumps({self._item_type:dict})
        json_data = self._redmine.post(target, payload)
        data = self._redmine.unwrap_json(self._item_type, json_data)
        data['_source_path'] = target
        return self._objectify(data=data)
139096
function() {
        var a  = storage.getItem(this.key)
        if (a) {
          a = JSON.parse(a)
        }
        if (a === null) storage.setItem(this.key, JSON.stringify([])) // lazy init
        return JSON.parse(storage.getItem(this.key))
      }
620541
def loads(inputStr):
    """"""
    inCat = json.loads(inputStr)
    assert CATALOGUE_TYPE in _values(inCat[CATALOGUE_METADATA], ISCONTENTTYPE_RELATION)
    # Manually copy mandatory fields, to check that they are they, and exclude other garbage
    desc = _values(inCat[CATALOGUE_METADATA], DESCRIPTION_RELATION)[0]  # TODO: We are ASSUMING just one description, which may not be true
    outCat = Hypercat(desc)
    for i in inCat[ITEMS]:
        href = i[HREF]
        contentType = _values(i[ITEM_METADATA], ISCONTENTTYPE_RELATION) [0]
        desc = _values(i[ITEM_METADATA], DESCRIPTION_RELATION) [0]
        if contentType == CATALOGUE_TYPE:
            r = Hypercat(desc)
        else:
            r = Resource(desc, contentType)
        outCat.addItem(r, href)

    return outCat
124772
def load(self, rawdata):
        
        if isinstance(rawdata, str):
            self.__parse_string(rawdata)
        else:
            # self.update() wouldn't call our custom __setitem__
            for key, value in rawdata.items():
                self[key] = value
        return
579889
def load(cls, path):
        
        auth = cls()
        with open(path) as fd:
            for pubkey in itertools.imap(str.strip, fd):
                # skip empty lines
                if not pubkey:
                    continue
                auth.add(pubkey)
        return auth
593988
def attributes(atts = {}, for_definition = false)
      wrapped_attributes atts, for_definition
      attributes_assignments atts, false, for_definition
      atts
    end
1205507
def load(key, options = {})
      if options[:sync] || (value = @cache.load(key, options)) == nil
        value = @adapter.load(key, options)
        @cache.store(key, value, options) if value != nil
      end
      value
    end
1321521
def _load_item(self, key):
        ''''''
        key_u   = key.upper()
        default = current_app.default_config.get(key_u)

        # One of the default config vars is a timedelta - interpret it
        # as an int and construct using it
        if isinstance(default, datetime.timedelta):
            current_app.config[key_u] = datetime.timedelta(self.getint('flask', key))
        elif isinstance(default, bool):
            current_app.config[key_u] = self.getboolean('flask', key)
        elif isinstance(default, float):
            current_app.config[key_u] = self.getfloat('flask', key)
        elif isinstance(default, int):
            current_app.config[key_u] = self.getint('flask', key)
        else:
            # All the string keys need to be coerced into str()
            # because Flask expects some of them not to be unicode
            current_app.config[key_u] = str(self.get('flask', key))
1047472
def initialize(self, data):
        
        for item in data:
            if hasattr(self, item):
                setattr(self, item, data[item])
997540
def populate_obj(obj, attrs):
    
    for k, v in attrs.iteritems():
        setattr(obj, k, v)
626999
def load_keys(path = nil)
        path ||= File.join(@path, @keydir)
        keys = Hash.new {|k,v| k[v] = DirtyProxy.new([])}

        list_keys(path).each do |key|
          new_key = SSHKey.from_file(File.join(path, key))
          owner = new_key.owner

          keys[owner] << new_key
        end
        #Mark key sets as unmodified (for dirty checking)
        keys.values.each{|set| set.clean_up!}

        keys
      end
256139
function _add_item(in_arg_key, data){

	var retval = false;
	if( typeof anchor.current_data[in_arg_key] == 'undefined' ){
	    // BUG/TODO: this should be a copy.
	    anchor.current_data[in_arg_key] = data;
	    //ll("add_item: adding key (w/data): " + in_arg_key);
	    retval = true;
	}
	return retval;
    }