Create the proper generated key value
321470
def generated_key(key):
    """"""
    key_name = key['name']
    if key['method'] == 'uuid':
        LOG.debug("Setting %s to a uuid", key_name)
        return str(uuid4())
    elif key['method'] == 'words':
        LOG.debug("Setting %s to random words", key_name)
        return random_word()
    elif key['method'] == 'static':
        if 'value' not in key.keys():
            raise aomi.exceptions.AomiData("Missing static value")

        LOG.debug("Setting %s to a static value", key_name)
        return key['value']
    else:
        raise aomi.exceptions.AomiData("Unexpected generated secret method %s"
                                       % key['method'])
1356448
def create_binary(self, key, value):
        
        data = None
        if key is not None and value is not None:
            try:
                # py2
                # convert to bytes as required for b64encode
                # decode bytes for json serialization as required for json dumps
                data = self.db.create(
                    key.strip(), json.dumps(base64.b64encode(bytes(value)).decode('utf-8'))
                )
            except TypeError:
                # py3
                # set encoding on string and convert to bytes as required for b64encode
                # decode bytes for json serialization as required for json dumps
                data = self.db.create(
                    key.strip(), json.dumps(base64.b64encode(bytes(value, 'utf-8')).decode('utf-8'))
                )
        else:
            self.tcex.log.warning(u'The key or value field was None.')
        return data
1356637
def new(cls, alias, sealed_obj, algorithm, key, key_size):
        
        timestamp = int(time.time()) * 1000

        raise NotImplementedError("Creating Secret Keys not implemented")
203633
def set key, value
      # capture new value in instance
      send("#{key}=", value)
      attributes.merge!(key => value)
      # and store it
      File.write UserConfig.config_path, YAML.dump(attributes)
    end
720916
function genStorageKey (ns, key) {
  return (ns === '') ? ns.concat(key) : ns.concat('.').concat(key);
}
246807
protected function generate_data_key() {
        global $DB;

        $key = new \stdClass();
        $key->handler = $this->handler->id;
        $key->datavalue = $this->datavalue;
        $key->datakey = md5($this->datavalue . '_' . time() . random_string(40));
        $key->timecreated = time();

        if ($this->handler->defaultexpiration) {
            // Apply the default expiration time to the datakey.
            $key->expires = $key->timecreated + $this->handler->defaultexpiration;
        }
        $DB->insert_record('messageinbound_datakeys', $key);

        return $key->datakey;
    }
1070888
function overwriteKeys(baseObject, overrideObject, createNew) {
  if (!baseObject) {
    baseObject = {};
  }
  if (createNew) {
    baseObject = JSON.parse(JSON.stringify(baseObject));
  }
  Object.keys(overrideObject).forEach(function(key) {
    if (isObjectAndNotArray(baseObject[key]) && isObjectAndNotArray(overrideObject[key])) {
      overwriteKeys(baseObject[key], overrideObject[key]);
    }
    else {
      baseObject[key] = overrideObject[key];
    }
  });
  return baseObject;
}
298096
def create_string(self, key, value):
        
        data = None
        if key is not None and value is not None:
            if isinstance(value, (bool, list, int, dict)):
                # value = str(value)
                value = u'{}'.format(value)
            # data = self.db.create(key.strip(), str(json.dumps(value)))
            data = self.db.create(key.strip(), u'{}'.format(json.dumps(value)))
        else:
            self.tcex.log.warning(u'The key or value field was None.')
        return data
1336114
protected function create_key() {
		if ( is_array( $this->data ) ) {
			$this->data[ $this->key ] = null;
		} elseif ( is_object( $this->data ) ) {
			$this->data->{$this->key} = null;
		} else {
			$type = gettype( $this->data );
			throw new UnexpectedValueException(
				"Cannot create key \"{$this->key}\" on data type {$type}"
			);
		}
	}
608966
def generate_valid_keys():
    
    valid_keys = []
    for minimum, maximum in RANGES:
        for i in range(ord(minimum), ord(maximum) + 1):
            valid_keys.append(chr(i))
    return valid_keys
367177
function create(key, value) {
  if (!Buffer.isBuffer(key)) {
    throw new TypeError('expected buffer')
  }

  return {
    key,
    value,
    left: null,
    right: null,
    height: 0
  }
}
1256496
def _generate_create_dict(record, record_type, data, ttl, **kwargs):
        """"""

        # Basic dns record structure
        resource_record = {
            'host': record,
            'data': data,
            'ttl': ttl,
            'type': record_type
        }

        for (key, value) in kwargs.items():
            resource_record.setdefault(key, value)

        return resource_record
818136
def can_create(self):
        
        if (
            self.data.get('key_name')
            and self.data.get('value_name')
            and self.data.get('value_type')
        ):
            return True
        return False
362717
def keys_create(cls, fqdn, flag):
        """"""
        data = {
            "flags": flag,
        }
        meta = cls.get_fqdn_info(fqdn)
        url = meta['domain_keys_href']
        ret, headers = cls.json_post(url, data=json.dumps(data),
                                     return_header=True)
        return cls.json_get(headers['location'])
1058516
def create_key_for_data(prefix, data, key_params):
    
    d = data.get_data()
    values = []
    for k in key_params:
        if k in d and type(d[k]) is list:
            values.append("{0}:{1}".format(k, " -".join(d[k])))
        else:
            value = d[k] if k in d else ''
            values.append("{0}:{1}".format(k, value))

    return "{0}-{1}".format(prefix, "-".join(values))
597195
def generate_slug(value):
    
    alphabet = app_settings.SLUG_ALPHABET
    salt = app_settings.SLUG_SALT

    hashids = Hashids(alphabet=alphabet, salt=salt, min_length=5)

    return hashids.encode(value)
1042053
def generate_key(self):
        
        req = self.request(self.uri + "/keys")
        private_key = req.post().json()
        return private_key['priv']