Save the key value base on it's storage type.
183385
def set_encode_key_value(self, value, store_type):
        """"""
        self._store_type = store_type
        if store_type == PUBLIC_KEY_STORE_TYPE_HEX:
            self._value = value.hex()
        elif store_type == PUBLIC_KEY_STORE_TYPE_BASE64:
            self._value = b64encode(value).decode()
        elif store_type == PUBLIC_KEY_STORE_TYPE_BASE85:
            self._value = b85encode(value).decode()
        elif store_type == PUBLIC_KEY_STORE_TYPE_JWK:
            # TODO: need to decide on which jwk library to import?
            raise NotImplementedError
        else:
            self._value = value
        return value
804042
def store(self, store_item):
        
        required_keys = {"type": str, "timestamp": float}
        
        if not isinstance(store_item, dict):
            raise TypeError("The stored item should be a dict")
           
        for k, v in required_keys.items(): 
            if k not in store_item:
                raise AttributeError("{} is not available. Please add it.".format(k))
            
            if not isinstance(store_item[k], v):
                raise TypeError("{} is not a {}. Please change it. ".format(k, v))
                #       
#         # TODO: CREATE FILTER FOR PERSISTENCE METHOD. Make sure it has the necessary data
#         to_store = {'field1': thing.field1,
#                     'date_field': thing.date_field,
#                     }
#         to_store['stuff'] = Binary(cPickle.dumps(thing.stuff))
        # Respect any soft-quota on write - raises if stats().totals.size > quota 
        self._arctic_lib.check_quota()
        self._collection.update(store_item, store_item, upsert=True)
1209766
def save( value )
      offset = 0
      value.class.typecodes.zip( value.values ).each do |t,v|
        @function << "#{@function.indent}*(#{GCCType.new( t ).identifier} *)( #{self} + #{offset} ) = #{v};\n"
        offset += t.storage_size
      end
    end
866712
def store(bank, key, data):
    '''
    
    '''
    _init_client()
    etcd_key = '{0}/{1}/{2}'.format(path_prefix, bank, key)
    try:
        value = __context__['serial'].dumps(data)
        client.write(etcd_key, base64.b64encode(value))
    except Exception as exc:
        raise SaltCacheError(
            'There was an error writing the key, {0}: {1}'.format(etcd_key, exc)
        )
964886
def store(self, key, pk, value):
        

        self.connection.zadd(key, value, pk)
744903
def store(key, value, options = {})
      return super if options.include?(:raw)
      expires = expires_at(options)
      super(key, new_entry(value, expires), Utils.without(options, :expires))
      value
    end
684280
def save_data(self):
        """"""
        filename = os.path.join(
            self._get_prefix(),
            self.model.site
        )
        self.store.store_json(
            filename,
            self.model.get_dict()
        )
1229052
def set(self, key, value):
        
        d = self.data.data
        keys = key.split('.')
        latest = keys.pop()
        for k in keys:
            d = d.setdefault(k, {})

        schema = Schema().load(self.schema_file)

        self.data.internal = schema.internal
        self.parse_value(d, '', key, value, schema.get(key))
        self.data.save(self.data_file)
331372
function (key, value) {
                var mappedKey = getMappedKey(key, true);

                storage.setAttribute(mappedKey, value);
                storage.save("JSONPersist");
            }
1354356
def save(self):
        """"""

        with open(self.store_file_path, 'w') as fh:
            fh.write(json.dumps(self.store, indent=4))
1301938
def SaveDataToFD(self, raw_data, fd):
    """"""
    for key, value in iteritems(raw_data):
      # TODO(hanuszczak): Incorrect type specification for `set`.
      # pytype: disable=wrong-arg-types
      self.set("", key, value=value)
      # pytype: enable=wrong-arg-types

    self.write(fd)
138160
def put(self, key, value):
    ''''''
    for store in self._stores:
      store.put(key, value)
1297379
def save(self, expires=None):
        """"""

        if expires is None:
            expires = self.expires
        s = self.serialize()
        key = self._key(self._all_keys())
        _cache.set(key, s, expires)
472236
function save() {
      var value, data = '';

      // localStorage can be disabled on WebKit/Gecko so make a dummy storage
      if (!hasOldIEDataSupport) {
        return;
      }

      for (var key in items) {
        value = items[key];
        data += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;
      }

      storageElm.setAttribute(userDataKey, data);

      try {
        storageElm.save(userDataKey);
      } catch (ex) {
        // Ignore disk full
      }

      updateKeys();
    }
1247943
private void storeOriginal(Pair<String, Object> keyValue) {
		String key = SharedPreferenceUtils.keyTestMode + keyValue.first;

		if (!preferenceUtils.isValueExistForKey(key)) {
			preferenceUtils.put(key, keyValue.second);

		}
	}
566950
def put(self, key, value, overwrite=True):
        
        self._get_table()
        s = self.to_string(value)
        log.debug("Storing in key '%s' the object: '%s'" % (key, s))
        self.table.put_item(
            data={
                'key': key,
                'value': s,
            },
            overwrite=overwrite
        )
1209090
def set(self, key, value):
        
        return DatastoreLegacy.store[self.domain].set(key, value)