Generate a UUID based on the given parameters.
427012
def __uuid(*args):
        """"""

        s = '-'.join(args)

        sha1 = hashlib.sha1(s.encode('utf-8', errors='surrogateescape'))
        uuid_sha1 = sha1.hexdigest()

        return uuid_sha1
192097
def handle_to_uuid(handle, services):
    """"""

    for service in services.values():
        for char_uuid, char_def in service['characteristics'].items():
            if char_def['handle'] == handle:
                return char_uuid

    raise ValueError("Handle not found in GATT table")
864942
def generate_id(self):
        """"""
        if self.use_repeatable_ids:
            self.repeatable_id_counter += 1
            return 'autobaked-{}'.format(self.repeatable_id_counter)
        else:
            return str(uuid4())
36434
function setUuid(node, uuid) {
    var uuidBytes = uuid instanceof KdbxUuid ? uuid.toBytes() : uuid;
    setBytes(node, uuidBytes);
}
485167
public void setUUID(UUID uuid)
    {
        if (uuid == null)
        {
            throw new IllegalArgumentException("'uuid' is null.");
        }

        mUUID = uuid;

        long msbits = uuid.getMostSignificantBits();
        long lsbits = uuid.getLeastSignificantBits();

        byte[] data = getData();
        data[UUID_INDEX +  0] = (byte)((msbits >> 56) & 0xFF);
        data[UUID_INDEX +  1] = (byte)((msbits >> 48) & 0xFF);
        data[UUID_INDEX +  2] = (byte)((msbits >> 40) & 0xFF);
        data[UUID_INDEX +  3] = (byte)((msbits >> 32) & 0xFF);
        data[UUID_INDEX +  4] = (byte)((msbits >> 24) & 0xFF);
        data[UUID_INDEX +  5] = (byte)((msbits >> 16) & 0xFF);
        data[UUID_INDEX +  6] = (byte)((msbits >>  8) & 0xFF);
        data[UUID_INDEX +  7] = (byte)((msbits      ) & 0xFF);
        data[UUID_INDEX +  8] = (byte)((lsbits >> 56) & 0xFF);
        data[UUID_INDEX +  9] = (byte)((lsbits >> 48) & 0xFF);
        data[UUID_INDEX + 10] = (byte)((lsbits >> 40) & 0xFF);
        data[UUID_INDEX + 11] = (byte)((lsbits >> 32) & 0xFF);
        data[UUID_INDEX + 12] = (byte)((lsbits >> 24) & 0xFF);
        data[UUID_INDEX + 13] = (byte)((lsbits >> 16) & 0xFF);
        data[UUID_INDEX + 14] = (byte)((lsbits >>  8) & 0xFF);
        data[UUID_INDEX + 15] = (byte)((lsbits >>  0) & 0xFF);
    }
336090
def gen_repr(cls, template, *args, **kwargs):
    """"""
    buf = io.StringIO()
    buf.write(u'<')
    buf.write(cls.__module__.decode() if kwargs.pop('full', False) else u'etc')
    buf.write(u'.')
    buf.write(cls.__name__.decode())
    if not kwargs.pop('dense', False):
        buf.write(u' ')
    buf.write(template.format(*args, **kwargs))
    options = kwargs.pop('options', [])
    for attr, value in options:
        if value is not None:
            buf.write(u' %s=%s' % (attr, value))
    buf.write(u'>')
    return buf.getvalue()
1220209
public static final void uuid(String uuid)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "uuid", uuid);

        _uuid = uuid;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "uuid");
    }
966475
def random_str_uuid(string_length):
    """"""
    if not isinstance(string_length, int) or not 1 <= string_length <= 32:
        msg = "string_length must be type int where 1 <= string_length <= 32"
        raise ValueError(msg)
    random = str(uuid.uuid4()).upper().replace('-', '')
    return random[0:string_length]
98420
def device_uuid(self):
        """"""
        if self._device:
            return self._device
        return GEN_ID_FORMAT.format(self.src_ip)
284892
def create_guid(self, collection=None):
        
        guid = str(uuid.uuid4())
        if collection:
            return str.join('/', [collection, guid])
        else:
            return guid
732237
def human_uuid():
    """"""
    return base64.b32encode(
        hashlib.sha1(uuid.uuid4().bytes).digest()).lower().strip('=')
148025
private function uuid(): string
    {
        return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
            mt_rand(0, 0xffff), mt_rand(0, 0xffff),
            mt_rand(0, 0xffff),
            mt_rand(0, 0x0fff) | 0x4000,
            mt_rand(0, 0x3fff) | 0x8000,
            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
        );
    }
909248
def _check_uuid_fmt(self):
        """"""
        if self.uuid_fmt not in UUIDField.FORMATS:
            raise FieldValueRangeException(
                "Unsupported uuid_fmt ({})".format(self.uuid_fmt))
356018
def uuid(anon, obj, field, val):
    
    return anon.faker.uuid(field=field)
816180
def generate_uuid_based_oid(length=None):
    
    length = min(length or OID_LENGTH, OID_MAX_LENGTH)

    while True:
        yield uuid.uuid4().hex.upper()[:length]
331283
def decode_uuid(value):
    """"""
    return uuid.UUID(bytes=bytes(bytearray(ffi.unpack(value.data, 16))))
280891
def is_uuid(u):
    """"""
    if isinstance(u, str) and u.replace('-', '') == uuid.UUID(u).hex:
        return u
    return False