def get_matching_rules(self, elem):
        # Quickly get some starting points.
        primaries = []
        primaries += self.names.get(elem.name, [])
        if elem.id:
            primaries += self.ids.get(elem.id, [])
        for c in elem.classes or ():
            primaries += self.classes.get(c, [])
        primaries += self.universals

        # Filter out non-matching
        matches = [rule for rule in primaries if self.matches(rule, elem)]

        # Order by specifity
        matches.sort(lambda a,b: a.specifity - b.specifity)

        return matches
The type with its final period removed if it is marked as a
dataset/ETHPy150Open ardekantur/pyglet/contrib/layout/layout/css.py/RuleSet.get_matching_rules--crossover with--dataset/ETHPy150Open nltk/nltk/nltk/tokenize/punkt.py/PunktToken.type_no_sentperiod