docstr: Core function to perform comparison.
  
  :param expected: A list of tuples (v1, v2, ((g1, o1), ..., (gN, oN)))
  with:
      - `v1` and `v2` two Variables (the graphs to be compared)
      - `gj` a `givens` dictionary to give as input to `is_same_graph`
      - `oj` the expected output of `is_same_graph(v1, v2, givens=gj)`
  
  :param debug: If True, then we make sure we are testing both
  implementations of `is_same_graph`.
  
  This function also tries to call `is_same_graph` by inverting `v1` and
  `v2`, and ensures the output remains the same.
docstr_tok: ["Core","function","to","perform","comparison",".",":","param","expected",":","A","list","of","tuples","(","v1",",","v2",",","(","(","g1",",","o1",")",",","...",",","(","gN",",","oN",")",")",")","with",":","-","`","v1","`","and","`","v2","`","two","Variables","(","the","graphs","to","be","compared",")","-","`","gj","`","a","`","givens","`","dictionary","to","give","as","input","to","`","is_same_graph","`","-","`","oj","`","the","expected","output","of","`","is_same_graph","(","v1",",","v2",",","givens=gj",")","`",":","param","debug",":","If","True",",","then","we","make","sure","we","are","testing","both","implementations","of","`","is_same_graph","`",".","This","function","also","tries","to","call","`","is_same_graph","`","by","inverting","`","v1","`","and","`","v2","`",",","and","ensures","the","output","remains","the","same","."]
code: def check(self, expected, debug=True):
      """
      Core function to perform comparison.
  
      :param expected: A list of tuples (v1, v2, ((g1, o1), ..., (gN, oN)))
      with:
          - `v1` and `v2` two Variables (the graphs to be compared)
          - `gj` a `givens` dictionary to give as input to `is_same_graph`
          - `oj` the expected output of `is_same_graph(v1, v2, givens=gj)`
  
      :param debug: If True, then we make sure we are testing both
      implementations of `is_same_graph`.
  
      This function also tries to call `is_same_graph` by inverting `v1` and
      `v2`, and ensures the output remains the same.
      """
      for v1, v2, go in expected:
          for gj, oj in go:
              r1 = is_same_graph(v1, v2, givens=gj, debug=debug)
              assert r1 == oj
              r2 = is_same_graph(v2, v1, givens=gj, debug=debug)
              assert r2 == oj
  
imports: from __future__ import absolute_import, print_function, division
  from itertools import count
  import pickle
  import unittest
  from nose.plugins.skip import SkipTest
  import numpy
  from theano import sparse, shared, tensor
  from theano.gof.graph import Apply, as_string, clone, general_toposort, inputs, io_toposort, is_same_graph, Variable
  from theano.gof.op import Op
  from theano.gof.type import Type
label_desc: Use image node_id 1 for calling the TestIsSameGraph obj's underlying member method code with example usage: obj.check(expected, debug) without return types