class_docstr: Implements the ISMAGS subgraph matching algorithm. [1]_ ISMAGS stands for
  "Index-based Subgraph Matching Algorithm with General Symmetries". As the
  name implies, it is symmetry aware and will only generate non-symmetric
  isomorphisms.
  
  Notes
  -----
  The implementation imposes additional conditions compared to the VF2
  algorithm on the graphs provided and the comparison functions
  (:attr:`node_equality` and :attr:`edge_equality`):
  
   - Node keys in both graphs must be orderable as well as hashable.
   - Equality must be transitive: if A is equal to B, and B is equal to C,
     then A must be equal to C.
  
  Attributes
  ----------
  graph: networkx.Graph
  subgraph: networkx.Graph
  node_equality: collections.abc.Callable
      The function called to see if two nodes should be considered equal.
      It's signature looks like this:
      ``f(graph1: networkx.Graph, node1, graph2: networkx.Graph, node2) -> bool``.
      `node1` is a node in `graph1`, and `node2` a node in `graph2`.
      Constructed from the argument `node_match`.
  edge_equality: collections.abc.Callable
      The function called to see if two edges should be considered equal.
      It's signature looks like this:
      ``f(graph1: networkx.Graph, edge1, graph2: networkx.Graph, edge2) -> bool``.
      `edge1` is an edge in `graph1`, and `edge2` an edge in `graph2`.
      Constructed from the argument `edge_match`.
  
  References
  ----------
  .. [1] M. Houbraken, S. Demeyer, T. Michoel, P. Audenaert, D. Colle,
     M. Pickavet, "The Index-Based Subgraph Matching Algorithm with General
     Symmetries (ISMAGS): Exploiting Symmetry for Faster Subgraph
     Enumeration", PLoS One 9(5): e97896, 2014.
     https://doi.org/10.1371/journal.pone.0097896
class_docstr_tok: ["Implements","the","ISMAGS","subgraph","matching","algorithm",".","[","1","]","_","ISMAGS","stands","for","''","Index-based","Subgraph","Matching","Algorithm","with","General","Symmetries","''",".","As","the","name","implies",",","it","is","symmetry","aware","and","will","only","generate","non-symmetric","isomorphisms",".","Notes","--","--","-","The","implementation","imposes","additional","conditions","compared","to","the","VF2","algorithm","on","the","graphs","provided","and","the","comparison","functions","(",":","attr",":","`","node_equality","`","and",":","attr",":","`","edge_equality","`",")",":","-","Node","keys","in","both","graphs","must","be","orderable","as","well","as","hashable",".","-","Equality","must","be","transitive",":","if","A","is","equal","to","B",",","and","B","is","equal","to","C",",","then","A","must","be","equal","to","C.","Attributes","--","--","--","--","--","graph",":","networkx.Graph","subgraph",":","networkx.Graph","node_equality",":","collections.abc.Callable","The","function","called","to","see","if","two","nodes","should","be","considered","equal",".","It","'s","signature","looks","like","this",":","``","f","(","graph1",":","networkx.Graph",",","node1",",","graph2",":","networkx.Graph",",","node2",")","-",">","bool","``",".","`","node1","`","is","a","node","in","`","graph1","`",",","and","`","node2","`","a","node","in","`","graph2","`",".","Constructed","from","the","argument","`","node_match","`",".","edge_equality",":","collections.abc.Callable","The","function","called","to","see","if","two","edges","should","be","considered","equal",".","It","'s","signature","looks","like","this",":","``","f","(","graph1",":","networkx.Graph",",","edge1",",","graph2",":","networkx.Graph",",","edge2",")","-",">","bool","``",".","`","edge1","`","is","an","edge","in","`","graph1","`",",","and","`","edge2","`","an","edge","in","`","graph2","`",".","Constructed","from","the","argument","`","edge_match","`",".","References","--","--","--","--","--","..","[","1","]","M.","Houbraken",",","S.","Demeyer",",","T.","Michoel",",","P.","Audenaert",",","D.","Colle",",","M.","Pickavet",",","``","The","Index-Based","Subgraph","Matching","Algorithm","with","General","Symmetries","(","ISMAGS",")",":","Exploiting","Symmetry","for","Faster","Subgraph","Enumeration","''",",","PLoS","One","9","(","5",")",":","e97896",",","2014.","https",":","\/\/doi.org\/10.1371\/journal.pone.0097896"]
docstr: Find a minimal set of permutations and corresponding co-sets that
  describe the symmetry of `graph`, given the node and edge equalities
  given by `node_partitions` and `edge_colors`, respectively.
  
  Parameters
  ----------
  graph : networkx.Graph
      The graph whose symmetry should be analyzed.
  node_partitions : list of sets
      A list of sets containing node keys. Node keys in the same set
      are considered equivalent. Every node key in `graph` should be in
      exactly one of the sets. If all nodes are equivalent, this should
      be ``[set(graph.nodes)]``.
  edge_colors : dict mapping edges to their colors
      A dict mapping every edge in `graph` to its corresponding color.
      Edges with the same color are considered equivalent. If all edges
      are equivalent, this should be ``{e: 0 for e in graph.edges}``.
  
  
  Returns
  -------
  set[frozenset]
      The found permutations. This is a set of frozensets of pairs of node
      keys which can be exchanged without changing :attr:`subgraph`.
  dict[collections.abc.Hashable, set[collections.abc.Hashable]]
      The found co-sets. The co-sets is a dictionary of
      ``{node key: set of node keys}``.
      Every key-value pair describes which ``values`` can be interchanged
      without changing nodes less than ``key``.
code: def analyze_symmetry(self, graph, node_partitions, edge_colors):
      """
      Find a minimal set of permutations and corresponding co-sets that
      describe the symmetry of `graph`, given the node and edge equalities
      given by `node_partitions` and `edge_colors`, respectively.
  
      Parameters
      ----------
      graph : networkx.Graph
          The graph whose symmetry should be analyzed.
      node_partitions : list of sets
          A list of sets containing node keys. Node keys in the same set
          are considered equivalent. Every node key in `graph` should be in
          exactly one of the sets. If all nodes are equivalent, this should
          be ``[set(graph.nodes)]``.
      edge_colors : dict mapping edges to their colors
          A dict mapping every edge in `graph` to its corresponding color.
          Edges with the same color are considered equivalent. If all edges
          are equivalent, this should be ``{e: 0 for e in graph.edges}``.
  
  
      Returns
      -------
      set[frozenset]
          The found permutations. This is a set of frozensets of pairs of node
          keys which can be exchanged without changing :attr:`subgraph`.
      dict[collections.abc.Hashable, set[collections.abc.Hashable]]
          The found co-sets. The co-sets is a dictionary of
          ``{node key: set of node keys}``.
          Every key-value pair describes which ``values`` can be interchanged
          without changing nodes less than ``key``.
      """
      if self._symmetry_cache is not None:
          key = hash(
              (
                  tuple(graph.nodes),
                  tuple(graph.edges),
                  tuple(map(tuple, node_partitions)),
                  tuple(edge_colors.items()),
              )
          )
          if key in self._symmetry_cache:
              return self._symmetry_cache[key]
      node_partitions = list(
          self._refine_node_partitions(
              graph, node_partitions, edge_colors
          )
      )
      assert len(node_partitions) == 1
      node_partitions = node_partitions[0]
      permutations, cosets = self._process_ordered_pair_partitions(
          graph, node_partitions, node_partitions, edge_colors
      )
      if self._symmetry_cache is not None:
          self._symmetry_cache[key] = permutations, cosets
      return permutations, cosets
  
imports: import itertools
  from collections import Counter, defaultdict
  from functools import reduce, wraps
label_desc: Use image node_id 18 for calling the ISMAGS obj's underlying member method code with example usage: obj.analyze_symmetry(graph, node_partitions, edge_colors) and returns: permutations,  cosets, self