code: def PatternOptimizer(p1, p2, ign=True):
      return gof.OpKeyOptimizer(
          gof.PatternSub(p1, p2), ignore_newtrees=ign
      )
  
imports: from __future__ import absolute_import, print_function, division
  import copy
  import six.moves.cPickle
  import numpy
  import unittest
  import time
  from theano import config, gof
  from six import iteritems
  from theano.compile.io import In, Out
  from theano.compile import function
  from theano.compile import UnusedInputError
  from theano.gof import MissingInputError
  from theano.compat import exc_message
  from theano.tests.unittest_tools import SkipTest
  from theano import tensor
  from theano import tensor
  import theano
label_desc: Use image node_id 1 for calling a global function with example usage: PatternOptimizer(p1, p2, ign) and returns: gof