code: def __init__(self, *patterns):
      self.patterns = []
      for pattern in patterns:
          if isinstance(pattern, string_types):
              self.patterns.append((pattern, ()))
          else:
              self.patterns.append((pattern[0], pattern[1:]))
  
imports: from __future__ import absolute_import, print_function, division
  from copy import copy
  import logging
  import os
  import sys
  import hashlib
  import numpy
  from six import string_types, integer_types, iteritems
  from six.moves import StringIO, reduce
  import theano
  from theano import gof
  from theano import config
  from theano.gof import Op, Apply
  from theano.compile import Function, debugmode, SharedVariable
label_desc: Use image node_id 1 to create a new PatternPrinter object  with example: obj = PatternPrinter()