Check if the uuid pattern matches the particular service uuid.
328353
private static boolean matchesServiceUuid(@NonNull  final UUID uuid,
											  @Nullable final UUID mask,
											  @NonNull  final UUID data) {
		if (mask == null) {
			return uuid.equals(data);
		}
		if ((uuid.getLeastSignificantBits() & mask.getLeastSignificantBits()) !=
				(data.getLeastSignificantBits() & mask.getLeastSignificantBits())) {
			return false;
		}
		return ((uuid.getMostSignificantBits() & mask.getMostSignificantBits()) ==
				(data.getMostSignificantBits() & mask.getMostSignificantBits()));
	}
1098236
def find_by_uuid(self, uuid):
        
        for entry in self.entries:
            if entry.uuid == uuid:
                return entry
        raise EntryNotFoundError("Entry not found for uuid: %s" % uuid)
789228
private boolean isUUID(String uuid) {
        try {
            UUID.fromString(uuid);
            return true;
        } catch (Exception ex) {
            return false;
        }
    }
70188
public function validate($uuid)
    {
        $uuid = str_replace(['urn:', 'uuid:', '{', '}'], '', $uuid);

        if ($uuid === Uuid::NIL || preg_match('/' . self::VALID_PATTERN . '/D', $uuid)) {
            return true;
        }

        return false;
    }
876450
public boolean matches(ApiRequest request) {
        String apiOrgId = request.getApiOrgId();
        String apiId = request.getApiId();
        String apiVersion = request.getApiVersion();
        return matches(apiOrgId, apiId, apiVersion);
    }
718802
def get_unresolved_support_uuids(stmts):
    """"""
    return {s.uuid for stmt in stmts for s in stmt.supports + stmt.supported_by
            if isinstance(s, Unresolved)}
877573
def matches_ip(self, ip):
        """"""

        # Check the cache if caching is enabled
        if self.cache is not None:
            matches_ip = self.cache.get(ip)
            if matches_ip is not None:
                return matches_ip

        # Query MongoDB to see if the IP is blacklisted
        matches_ip = IPNetwork.matches_ip(
            ip, read_preference=self.read_preference)

        # Cache the result if caching is enabled
        if self.cache is not None:
            self.cache[ip] = matches_ip

        return matches_ip
996504
public static boolean isUuid(final String uuid) {
        return uuid != null && (uuid.length() == 36 || uuid.length() == 32)
                && UUID_PATTERN.matcher(uuid).matches();
    }
280891
def is_uuid(u):
    """"""
    if isinstance(u, str) and u.replace('-', '') == uuid.UUID(u).hex:
        return u
    return False
1236583
public boolean matches(HttpServletRequest request) {
    if (httpMethod != null && httpMethod != HttpMethod.valueOf(request.getMethod())) { return false; }
    String url = request.getServletPath();
    String pathInfo = request.getPathInfo();
    String query = request.getQueryString();

    if (pathInfo != null || query != null) {
      StringBuilder sb = new StringBuilder(url);
      if (pathInfo != null) sb.append(pathInfo);
      if (query != null) sb.append(query);
      url = sb.toString();
    }
    logger.debug("Checking match of request : '{}'; against '{}'", url, pattern);
    return pattern.matcher(url).matches();
  }
1335086
public static boolean isValidUUID(String uuid) {
        return !StringUtils.isEmpty(uuid) && UUID_PATTERN.matcher(uuid).matches();
    }
345200
function uuid(version) {
    var v = (version) ? version : '';

    // verify its a valid string
    this.assert(
      (typeof this._obj === 'string' || this._obj instanceof String),
      'expected #{this} to be of type #{exp} but got #{act}',
      'expected #{this} to not be of type #{exp}',
      'string',
      typeof(this._obj)
    );

    // assert it is a valid uuid
    var regex = getRegEx(v);
    this.assert(
      regex.test(this._obj),
      'expected #{this} to be a valid UUID ' + v,
      'expected #{this} to not be a UUID ' + v
    );    
  }
1089986
public Entry getEntryByUUID(final UUID UUID) {
        List<Entry> allEntries = getEntries();

        List<Entry> entries = ListFilter.filter(allEntries, new Filter<Entry>() {

            @Override
            public boolean matches(Entry item) {

                if (item.getUuid() != null && item.getUuid().compareTo(UUID) == 0) {
                    return true;
                } else {
                    return false;
                }
            }
        });

        if (entries.size() == 1) {
            return entries.get(0);
        } else {
            return null;
        }
    }
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")
1032987
def IsCloud(self, request, bios_version, services):
    """"""
    if request.bios_version_regex and bios_version:
      if re.match(request.bios_version_regex, bios_version):
        return True
    if request.service_name_regex and services:
      if re.search(request.service_name_regex, services):
        return True
    return False
1080202
def is_acquired(self):
        """"""
        values = self.client.get(self.key)
        return six.b(self._uuid) in values
346197
def is_valid_ip_pattern(ip):
    """"""
    ip = ip.replace('*', '1')
    try:
        socket.inet_aton(ip)
        return True
    except socket.error:
        # Not a valid IPv4 address pattern
        return False