Returns true if the passed glob matches the id
188935
def match(tgt, opts=None):
    '''
    
    '''
    if not opts:
        opts = __opts__
    if not isinstance(tgt, six.string_types):
        return False

    return fnmatch.fnmatch(opts['id'], tgt)
426457
def contains_glob(path, glob_expr):
    '''
    
    '''
    path = os.path.expanduser(path)

    if not os.path.exists(path):
        return False

    try:
        with salt.utils.filebuffer.BufferedReader(path) as breader:
            for chunk in breader:
                if fnmatch.fnmatch(chunk, glob_expr):
                    return True
            return False
    except (IOError, OSError):
        return False
149995
function(id) {
			var i;
			for (i = files.length - 1; i >= 0; i--) {
				if (files[i].id === id) {
					return files[i];
				}
			}
		}
638448
public boolean matchesGlobalId(byte[] globalTransactionId) {
        if (globalTransactionId.length != Xid.MAXGTRIDSIZE) {
            return false;
        }
        for (int i = 8; i < globalTransactionId.length; i++) {
            if (globalTransactionId[i] != baseId[i]) {
                return false;
            }
        }
        // for recovery, only match old transactions
        long id = extractLong(globalTransactionId, 0);
        return (id < start);
    }
527659
def containsID(self, idVal):
        
        for i in self:
            if i.id == idVal:
                return True
        return False
1071205
def _fs_match(pattern, filename, sep, follow, symlinks):
    

    matched = False

    base = None
    m = pattern.fullmatch(filename)
    if m:
        matched = True
        # Lets look at the captured `globstar` groups and see if that part of the path
        # contains symlinks.
        if not follow:
            groups = m.groups()
            last = len(groups)
            for i, star in enumerate(m.groups(), 1):
                if star:
                    parts = star.strip(sep).split(sep)
                    if base is None:
                        base = filename[:m.start(i)]
                    for part in parts:
                        base = os.path.join(base, part)
                        is_link = symlinks.get(base, None)
                        if is_link is not None:
                            matched = not is_link
                        elif i != last or os.path.isdir(base):
                            is_link = os.path.islink(base)
                            symlinks[base] = is_link
                            matched = not is_link
                        if not matched:
                            break
                if matched:
                    break
    return matched
1189078
def identify_id(id: str) -> bool:
    
    return re.match(r'^https?://', id, flags=re.IGNORECASE) is not None
207480
def _get_by_id(collection, id):
    '''
    
    '''
    matches = [item for item in collection if item.id == id]
    if not matches:
        raise ValueError('Could not find a matching item')
    elif len(matches) > 1:
        raise ValueError('The id matched {0} items, not 1'.format(len(matches)))
    return matches[0]
527851
function checkOld (id, ts) {
    return false
    if(sources[id] && sources[id] >= ts) return true
    sources[id] = ts
  }
237516
function pathMatchesGlobs(filePath, patterns, excludedPatterns) {
  const patternList = [].concat(patterns);
  const excludedPatternList = [].concat(excludedPatterns || []);
  const opts = { matchBase: true };

  return (
    patternList.some(pattern => minimatch(filePath, pattern, opts)) &&
    !excludedPatternList.some(excludedPattern =>
      minimatch(filePath, excludedPattern, opts)
    )
  );
}
224783
def isglob(value):
    
    if os.name == 'nt':
        if isinstance(value, basestring):
            value = glob.glob(value)
    return value
403351
def match(tgt, opts=None):
    '''
    
    '''
    if not opts:
        return bool(re.match(tgt, __opts__['id']))
    else:
        return bool(re.match(tgt, opts['id']))
683935
def include(self, pattern):
        """"""
        found = [f for f in glob(pattern) if not os.path.isdir(f)]
        self.extend(found)
        return bool(found)
570236
private boolean matchTuple( Object o )
    {
        // Check for null and type
        if ( o == null || !( o instanceof VersionID ) )
        {
            return false;
        }
        VersionID vid = (VersionID) o;

        // Normalize arrays
        String[] t1 = normalize( _tuple, vid._tuple.length );
        String[] t2 = normalize( vid._tuple, _tuple.length );

        // Check contents
        for ( int i = 0; i < t1.length; i++ )
        {
            Object o1 = getValueAsObject( t1[i] );
            Object o2 = getValueAsObject( t2[i] );
            if ( !o1.equals( o2 ) )
            {
                return false;
            }
        }
        return true;
    }
1093009
def CheckBlobsExist(self, blob_ids, cursor=None):
    """"""
    if not blob_ids:
      return {}

    exists = {blob_id: False for blob_id in blob_ids}
    query = ("SELECT blob_id "
             "FROM blobs "
             "FORCE INDEX (PRIMARY) "
             "WHERE blob_id IN {}".format(
                 mysql_utils.Placeholders(len(blob_ids))))
    cursor.execute(query, [blob_id.AsBytes() for blob_id in blob_ids])
    for blob_id, in cursor.fetchall():
      exists[rdf_objects.BlobID.FromBytes(blob_id)] = True
    return exists
1017950
def glob_in_parents(dir, patterns, upper_limit=None):
    """"""

    assert(isinstance(dir, str))
    assert(isinstance(patterns, list))

    result = []

    absolute_dir = os.path.join(os.getcwd(), dir)
    absolute_dir = os.path.normpath(absolute_dir)
    while absolute_dir:
        new_dir = os.path.split(absolute_dir)[0]
        if new_dir == absolute_dir:
            break
        result = glob([new_dir], patterns)
        if result:
            break
        absolute_dir = new_dir

    return result
251664
private boolean isValidUuid(final String id) {

		if (id != null) {

			if (id.length() != 32) {
				return false;
			}

			return UUID_PATTERN.matcher(id).matches();
		}

		return false;
	}