Check that any state in ComplexPattern2 is matched in ComplexPattern1.
321918
def _cp_embeds_into(cp1, cp2):
    
    # Check that any state in cp2 is matched in cp1
    # If the thing we're matching to is just a monomer pattern, that makes
    # things easier--we just need to find the corresponding monomer pattern
    # in cp1
    if cp1 is None or cp2 is None:
        return False
    cp1 = as_complex_pattern(cp1)
    cp2 = as_complex_pattern(cp2)
    if len(cp2.monomer_patterns) == 1:
        mp2 = cp2.monomer_patterns[0]
        # Iterate over the monomer patterns in cp1 and see if there is one
        # that has the same name
        for mp1 in cp1.monomer_patterns:
            if _mp_embeds_into(mp1, mp2):
                return True
    return False
1133568
def match1(pattern, data, **parse_kwargs):
    """"""
    matches = match(pattern, data, **parse_kwargs)
    return matches[0] if matches else None
63001
def is_match(subject: Expression, pattern: Expression) -> bool:
    
    return any(True for _ in match(subject, pattern))
1231963
def compare(self, vertex0, vertex1, subject_graph):
        """"""
        return (
            self.pattern_graph.vertex_fingerprints[vertex0] ==
            subject_graph.vertex_fingerprints[vertex1]
        ).all()
684927
def is_same(type1, type2):
    """"""
    nake_type1 = remove_declarated(type1)
    nake_type2 = remove_declarated(type2)
    return nake_type1 == nake_type2
1170212
public static boolean check(Tile tile1, Tile tile2, Tile tile3, Tile tile4) {
        return tile1 == tile2 && tile2 == tile3 && tile3 == tile4;
    }
593964
def overlaps_with(self, othermatch, strict=False):
        '''
        
        '''
        one = self.matches_entry(othermatch, strict)
        if strict:
            return one
        return one and othermatch.matches_entry(self, strict)
140258
def matches(self, a, b, **config):
        
        submitter_a = a['msg']['override']['submitter']['name']
        submitter_b = b['msg']['override']['submitter']['name']
        if submitter_a != submitter_b:
            return False
        return True
709187
private void resolvePatternSpecificity(Map<String, PatternCacheControl> patterns) {
        List<String> patternList = new ArrayList<>();
        patternList.addAll(patterns.keySet());

        int patternCount = patternList.size();

        for (int i = 0; i < patternCount - 1; i++) {
            String specificPattern = patternList.get(i);
            for (int j = i + 1; j < patternCount; j++) {
                String generalPattern = patternList.get(j);
                checkPatternMatching(patterns, specificPattern, generalPattern);
                checkPatternMatching(patterns, generalPattern, specificPattern);
            }
        }
    }
133335
def condition2checker(condition):
    """"""
    if isinstance(condition, string_types):
        def smatcher(info):
            return fnmatch.fnmatch(info.filename, condition)

        return smatcher
    elif isinstance(condition, (list, tuple)) and isinstance(condition[0],
                                                             integer_types):
        def imatcher(info):
            return info.index in condition

        return imatcher
    elif callable(condition):
        return condition
    else:
        raise TypeError
390969
def exists(self, pattern, **match_kwargs):
        
        ret = self.match(pattern, **match_kwargs)
        if ret is None:
            return None
        if not ret.matched:
            return None
        return ret
805480
def matches_pattern(self, other):
        
        properties = self._message_properties()
        ismatch = False
        if isinstance(other, Message) and self.code == other.code:
            for prop in properties:
                for key, prop_val in prop.items():
                    if hasattr(other, key):
                        key_val = getattr(other, key)
                        ismatch = self._test_match(prop_val, key_val)
                    else:
                        ismatch = False
                    if not ismatch:
                        break
                if not ismatch:
                    break
        return ismatch
979102
private final static boolean valuesMatch(Object value1, Object value2) {
        if (value1 == null) {
            return value2 == null;
        } else {
            return value1.equals(value2);
        }
    }
1092380
def __get_match_result(self, ret, ret2):
        
        if self.another_compare == "__MATCH_AND__":
            return ret and ret2
        elif self.another_compare == "__MATCH_OR__":
            return ret or ret2
        return ret
1150462
def match(self, other):
        """"""

        if len(self) != len(other):
            raise ValueError()
        for s1, s2 in zip(self, other):
            i = s2.position - s1.position
            if i < 0:
                return False
            n = len(s1)
            while i+n > len(s2) and s1[n-1] == syntax.BLANK:
                n -= 1
            if s2.values[i:i+n] != s1.values[:n]:
                return False
        return True
857235
private boolean checkPattern(Mtp2Buffer frame, int sltmLen, byte[] pattern) {
        if (sltmLen != pattern.length) {
            return false;
        }
        for (int i = 0; i < pattern.length; i++) {
            if (frame.frame[i + PATTERN_OFFSET] != pattern[i]) {
                return false;
            }
        }
        return true;
    }
1089049
public boolean matches(String cn) {
        if (includePattern == null)
            return true;

        if (includePattern != null)
            return includePattern.matcher(cn).matches();

        return false;
    }