Find the corresponding UUID for an attribute handle
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")
67358
def uuid_object(title="Reference", description="Select an object", default=None, display=True):
    """"""

    uuid = {
        'pattern': '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{'
                   '4}-['
                   'a-fA-F0-9]{4}-[a-fA-F0-9]{12}$',
        'type': 'string',
        'title': title,
        'description': description,
    }

    if not display:
        uuid['x-schema-form'] = {
            'condition': "false"
        }

    if default is not None:
        uuid['default'] = default

    return uuid
1234185
def prepare_uuid(data, schema):
    
    if isinstance(data, uuid.UUID):
        return str(data)
    else:
        return data
161872
def uuid(value = nil)
      if value.nil?
        timeuuid_generator.now
      elsif value.is_a?(Time)
        timeuuid_generator.at(value)
      elsif value.is_a?(DateTime)
        timeuuid_generator.at(Time.at(value.to_f))
      else
        Type::Timeuuid.instance.cast(value)
      end
    end
561868
def get_uuids():
    """"""
    result = shell('cl ls -w {} -u'.format(worksheet))
    uuids = result.split('\n')
    uuids = uuids[1:-1]  # trim non uuids
    return uuids
4141
def uuid(dev=None):
    '''
    

    '''
    try:
        if dev is None:
            # take the only directory in /sys/fs/bcache and return it's basename
            return list(salt.utils.path.os_walk('/sys/fs/bcache/'))[0][1][0]
        else:
            # basename of the /sys/block/{dev}/bcache/cache symlink target
            return os.path.basename(_bcsys(dev, 'cache'))
    except Exception:
        return False
521695
public static boolean isUUID(BufferedString str) {
    boolean res;
    int old = str.getOffset();
    attemptUUIDParseLow(str);
    attemptUUIDParseHigh(str);
    res = str.getOffset() != -1;
    str.setOff(old);
    return res;
  }
266249
def _get_genestr(self, itemid):
        """"""
        if itemid in self.id2symbol:
            symbol = self.id2symbol[itemid]
            if symbol is not None:
                return symbol
        if isinstance(itemid, int):
            return str(itemid)
        return itemid
240330
def getAttr(self, node, name, nsuri=None, default=join):
        """"""
        if nsuri is None:
            result = node._attrs.get(name, None)
            if result is None:
                for item in node._attrsNS.keys():
                    if item[1] == name:
                        result = node._attrsNS[item]
                        break
        else:
            result = node._attrsNS.get((nsuri, name), None)
        if result is not None:
            return result.value
        if default is not join:
            return default
        return ''
984439
def get(self, uuid):
        
        args = {'uuid':uuid}
        self._get_chk.check(args)
        return self._client.json('kvm.get', args)
1131467
def get_id(self):
        """"""
        if self._id_attr is None or not hasattr(self, self._id_attr):
            return None
        return getattr(self, self._id_attr)
555431
def conv_uuid(self, column, name, **kwargs):
        """"""
        return [f(column, name, **kwargs) for f in self.uuid_filters]
942064
private Map<String, ComponentDto> indexExistingDtosByUuids(DbSession session) {
    return dbClient.componentDao().selectAllComponentsFromProjectKey(session, treeRootHolder.getRoot().getDbKey())
      .stream()
      .collect(Collectors.toMap(ComponentDto::uuid, Function.identity()));
  }
942880
def _encode_uuid(name, value, dummy, opts):
    """"""
    uuid_representation = opts.uuid_representation
    # Python Legacy Common Case
    if uuid_representation == OLD_UUID_SUBTYPE:
        return b"\x05" + name + b'\x10\x00\x00\x00\x03' + value.bytes
    # Java Legacy
    elif uuid_representation == JAVA_LEGACY:
        from_uuid = value.bytes
        data = from_uuid[0:8][::-1] + from_uuid[8:16][::-1]
        return b"\x05" + name + b'\x10\x00\x00\x00\x03' + data
    # C# legacy
    elif uuid_representation == CSHARP_LEGACY:
        # Microsoft GUID representation.
        return b"\x05" + name + b'\x10\x00\x00\x00\x03' + value.bytes_le
    # New
    else:
        return b"\x05" + name + b'\x10\x00\x00\x00\x04' + value.bytes
1209928
def _get_id(self):
        """"""
        return ''.join(map(str,
                           filter(is_not_None,
                                  [self.Prefix, self.Name])))
1145629
def get_uuid_list(dbconn):
    
    cur = dbconn.cursor()
    tables = get_table_list(dbconn)
    uuids = set()
    for table in tables:
        cur.execute("SELECT (UUID) FROM '{table}'".format(table=table))
        uuid = set([i[0] for i in cur.fetchall()])
        if uuid:
            uuids.update(uuid)
    return uuids
418834
def _get_attr_like_prefix(self, sig):
        """"""
        sig_match = chpl_attr_sig_pattern.match(sig)
        if sig_match is None:
            return ChapelObject.get_signature_prefix(self, sig)

        prefixes, _, _, _ = sig_match.groups()
        if prefixes:
            return prefixes.strip() + ' '
        elif self.objtype == 'type':
            return 'type' + ' '
        else:
            return ChapelObject.get_signature_prefix(self, sig)