code: def process(self, output, pstate):
      if output in pstate.memo:
          return pstate.memo[output]
      pprinter = pstate.pprinter
      node = output.owner
      if node is None:
          raise TypeError(
              "operator %s cannot represent a variable that is "
              "not the result of an operation" % self.operator
          )
  
      # Precedence seems to be buggy, see #249
      # So, in doubt, we parenthesize everything.
      # outer_precedence = getattr(pstate, 'precedence', -999999)
      # outer_assoc = getattr(pstate, 'assoc', 'none')
      # if outer_precedence > self.precedence:
      #    parenthesize = True
      # else:
      #    parenthesize = False
      parenthesize = True
  
      input_strings = []
      max_i = len(node.inputs) - 1
      for i, input in enumerate(node.inputs):
          new_precedence = self.precedence
          if (
              self.assoc == "left"
              and i != 0
              or self.assoc == "right"
              and i != max_i
          ):
              new_precedence += 1e-6
          try:
              old_precedence = getattr(pstate, "precedence", None)
              pstate.precedence = new_precedence
              s = pprinter.process(input, pstate)
          finally:
              pstate.precedence = old_precedence
          input_strings.append(s)
      if len(input_strings) == 1:
          s = self.operator + input_strings[0]
      else:
          s = (" %s " % self.operator).join(input_strings)
      if parenthesize:
          r = "(%s)" % s
      else:
          r = s
      pstate.memo[output] = r
      return r
  
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 2 for calling the OperatorPrinter obj's underlying member method code with example usage: obj.process(output, pstate) and returns: r, pstate