Add a key-value pair to the extra_data dict.

        This can be used to add attributes that are not available when
        ray.profile was called.

        Args:
            key: The attribute name.
            value: The attribute value.
774518
def set_attribute(self, key, value):
        
        if not isinstance(key, str) or not isinstance(value, str):
            raise ValueError("The arguments 'key' and 'value' must both be "
                             "strings. Instead they are {} and {}.".format(
                                 key, value))
        self.extra_data[key] = value
958678
def add(self, key, value, key_length=0):
        
        if key_length < 1:
            key_length = len(key)
        val = self.add_method(self, key, key_length, value)
        if self.k:
            self._update(key, value)
        return val
985108
def append(self, name, value):
        
        if self.vars is None:
            self.vars = {}
        if name in self.vars:
            self.vars[name].append(value)
        else:
            self.vars[name] = [value]
594774
def _add_additional_properties(position, properties_dict):
        
        add_prop = etree.SubElement(position, 'AdditionalProperties')
        for key, value in properties_dict.items():
            etree.SubElement(add_prop, 'Property', attrib={'name': key, 'value': value})
536871
def _set(self, key, value, identity='image'):
        
        if identity == 'image':
            s = serialize_image_file(value)
        else:
            s = serialize(value)
        self._set_raw(add_prefix(key, identity), s)
528326
def extra(self):
        
        return dict([(key, val) for key, val in
                     self._dict.items() if key not in self.c_param])
588411
def add(self, key, val, time = 0, min_compress_len = 0):
        '''
        
        '''
        return self._set("add", key, val, time, min_compress_len)
904841
def _append_value(self, value, _file, _name):
        
        _tabs = '\t' * self._tctr
        _keys = '{tabs}<key>{name}</key>\n'.format(tabs=_tabs, name=_name)
        _file.seek(self._sptr, os.SEEK_SET)
        _file.write(_keys)

        self._append_dict(value, _file)
477700
def add(self, key, value):
        
        if not key in self.prefs:
            self.prefs[key] = []
        self.prefs[key].append(value)
1148744
def new_value(self, key, value):
        """"""
        data = self.model.get_data()
        data[key] = value
        self.set_data(data)
127456
def AddValue(self, registry_value):
    
    name = registry_value.name.upper()
    if name in self._values:
      raise KeyError(
          'Value: {0:s} already exists.'.format(registry_value.name))

    self._values[name] = registry_value
1133611
def add_exp_key(self, key, value, ex):
        ""
        return self.c.set(key, value, ex)
668587
def add_key(self, ref, mode="shared"):
        
        if ref not in self.keys:
            response = self.request("client_add_key %s -%s" % (ref, mode))
            if "success" not in response:
                return None
            self.keys.append(ref)
            return ref
597737
def add(self, key, value):
        
        if isinstance(value, list):
            # TODO: support env vars in list w/masked values
            for val in value:
                self._add_arg_python(key, val)
        elif isinstance(value, dict):
            err = 'Dictionary types are not currently supported for field.'
            print('{}{}{}'.format(c.Style.BRIGHT, c.Fore.RED, err))
        else:
            mask = False
            env_var = re.compile(r'^\$env\.(.*)$')
            envs_var = re.compile(r'^\$envs\.(.*)$')

            if env_var.match(str(value)):
                # read value from environment variable
                env_key = env_var.match(str(value)).groups()[0]
                value = os.environ.get(env_key, value)
            elif envs_var.match(str(value)):
                # read secure value from environment variable
                env_key = envs_var.match(str(value)).groups()[0]
                value = os.environ.get(env_key, value)
                mask = True
            self._add_arg(key, value, mask)
639314
def set(self, key: str, value: Any) -> None:
        
        wc = self._write_cache()
        if key in wc:
            s = wc[key]
        else:
            s = self._type(object=self._obj, key=key)
        s.value = self._serialize(value)
        s.save()
        self._cache()[key] = s.value
        wc[key] = s
        self._flush_external_cache()
142995
def add_format(self, key, value=None):
        
        if key in self.FORMAT:
            return
        self.FORMAT.append(key)
        if value is not None:
            for call in self:
                call.data.setdefault(key, value)
346793
def add_api_key(key, value):
    

    if key is None or key == "":
        logger.error("Key cannot be empty")

    if value is None or value == "":
        logger.error("Value cannot be empty")

    from .. import datatools
    data = datatools.get_data()

    if "keys" not in data["discord"]:
        data["discord"]["keys"] = {}

    is_key_new = False
    if key not in data["discord"]["keys"]:
        is_key_new = True
    elif data["discord"]["keys"][key] == value:
        logger.info("API key '{}' already has value '{}'".format(key, value))
        return

    data["discord"]["keys"][key] = value
    datatools.write_data(data)

    key_text = "added" if is_key_new else "updated"
    logger.info("API key '{}' {} with value '{}'".format(key, key_text, value))