Adds a key to the bot's data

    Args:
        key: The name of the key to add
        value: The value for the key
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))
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
1158205
def add(self, data, key=None):
        
        sink = self.options[key] if key is not None else self.data
        for key, value in iteritems(data):
            sink.add(key, value)
417127
def append_config_item(self, key, value):
        

        return _lxc.Container.set_config_item(self, key, value)
30416
def add_key(self, key, label, notes=None):
        
        order = {
            'key': key,
            'label': label,
            'notes': notes,
        }

        return self.sshkey.createObject(order)
260039
def set_info(self, key, value, append=True):
        
        if append:
            if key not in self.info:
                self.info[key] = []
            self.info[key].append(value)
        else:
            self.info[key] = value
85813
def send_key(self, key):
        
        cmd = struct.pack(">BBBBBBH", 4, 1, 0, 0, 0, 0, key)
        self.con.send(cmd)

        cmd = struct.pack(">BBBBBBH", 4, 0, 0, 0, 0, 0, key)
        self.con.send(cmd)
1069045
def create_and_add(self, key, value=None, cas=0, **options):
        
        itm = Item(key, value)
        itm.cas = cas
        return self.add(itm, **options)
1154001
def add_kb_mapping(kb_name, key, value=""):
    
    kb = get_kb_by_name(kb_name)
    if key in kb.kbrvals:
        # update
        kb.kbrvals[key].m_value = value
    else:
        # insert
        kb.kbrvals.set(models.KnwKBRVAL(m_key=key, m_value=value))
1269476
def setKey(self, key, value):
		
		data = self.getDictionary()
		data[key] = value
		self.setDictionary(data)
525903
def add_custom_metadata(self, key, value, meta_type=None):
        
        self.metadata.append({'key': key, 'value': value, 'type': meta_type})
1330053
public Payload add(String key, String value) {
    getData().put(key, value);
    return this;
  }
822425
def increment(self, key, amount=1):
        
        payload = {
            key: {
                '__op': 'Increment',
                'amount': amount
                }
            }
        self.__class__.PUT(self._absolute_url, **payload)
        self.__dict__[key] += amount
178803
def add(self, key, value):
        '''
        
        '''
        if key in self.reserved_keys:
            raise Exception('You cannot add the key %s directly, use %s' % (key, self.reserved_keys[key]))
        if isinstance(value, Report):
            self._sub_reports[key] = value
            self._data_fields['sub_reports'].append(key)
        else:
            self._data_fields[key] = value
170404
def set(self, key: str, value: str, opt: dict = None) -> None:
        
        self[key] = value
        if opt is not None:
            self[key].update(opt)
588411
def add(self, key, val, time = 0, min_compress_len = 0):
        '''
        
        '''
        return self._set("add", key, val, time, min_compress_len)
1334675
def set_key(key: str, value: str) -> dict:
    
    if not _conf.path:
        return {}

    if "toml" in _conf.path:
        with open(_conf.path, "r") as f:
            parser = parse(f.read())
        parser["tool"]["commitizen"][key] = value
        with open(_conf.path, "w") as f:
            f.write(parser.as_string())
    else:
        parser = configparser.ConfigParser()
        parser.read(_conf.path)
        parser["commitizen"][key] = value
        with open(_conf.path, "w") as f:
            parser.write(f)

    return _conf.config