def _semantic_feasibility(self, G1_node, G2_node):
 if (self.node_match is not None):
  nm = self.node_match(self.G1.node[G1_node], self.G2.node[G2_node])
  if (not nm):
   return False
 if (self.edge_match is not None):
  G1_adj = self.G1_adj
  G2_adj = self.G2_adj
  core_1 = self.core_1
  edge_match = self.edge_match
  for neighbor in G1_adj[G1_node]:
   if (neighbor == G1_node):
    if (not edge_match(G1_adj[G1_node][G1_node], G2_adj[G2_node][G2_node])):
     return False
   elif (neighbor in core_1):
    if (not edge_match(G1_adj[G1_node][neighbor], G2_adj[G2_node][core_1[neighbor]])):
     return False
 return True

def _semantic_feasibility ( self , G1_node , G2_node ) : if ( self . node_match is not None ) : nm = self . node_match ( self . G1 . node [ G1_node ] , self . G2 . node [ G2_node ] ) if ( not nm ) : return False if ( self . edge_match is not None ) : G1_adj = self . G1_adj G2_adj = self . G2_adj core_1 = self . core_1 edge_match = self . edge_match for neighbor in G1_adj [ G1_node ] : if ( neighbor == G1_node ) : if ( not edge_match ( G1_adj [ G1_node ] [ G1_node ] , G2_adj [ G2_node ] [ G2_node ] ) ) : return False elif ( neighbor in core_1 ) : if ( not edge_match ( G1_adj [ G1_node ] [ neighbor ] , G2_adj [ G2_node ] [ core_1 [ neighbor ] ] ) ) : return False return True
returns true if mapping g1_node to g2_node is semantically feasible .