def test_match(self, match, pattern_graph, subject_graph):
        """Test if a match satisfies the criteria"""
        for vertex0, c in self.vertex_criteria.items():
            vertex1 = match.forward[vertex0]
            if not c(vertex1, subject_graph):
                return False
        for edge0_index, c in self.edge_criteria.items():
            vertex0a, vertex0b = pattern_graph.edges[edge0_index]
            edge1_index = subject_graph.edge_index[frozenset([
                match.forward[vertex0a],
                match.forward[vertex0b],
            ])]
            if not c(edge1_index, subject_graph):
                return False
        return True
def test_match ( self , match , pattern_graph , subject_graph ) : for vertex0 , c in self . vertex_criteria . items ( ) : vertex1 = match . forward [ vertex0 ] if not c ( vertex1 , subject_graph ) : return False for edge0_index , c in self . edge_criteria . items ( ) : vertex0a , vertex0b = pattern_graph . edges [ edge0_index ] edge1_index = subject_graph . edge_index [ frozenset ( [ match . forward [ vertex0a ] , match . forward [ vertex0b ] , ] ) ] if not c ( edge1_index , subject_graph ) : return False return True
Test if a match satisfies the criteria