code: def test_pickle(self):
      a = T.scalar()  # the a is for 'anonymous' (un-named).
      x, s = T.scalars("xs")
  
      f = function(
          [
              x,
              In(a, value=1.0, name="a"),
              In(s, value=0.0, update=s + a * x, mutable=True),
          ],
          s + a * x,
      )
  
      try:
          # Note that here we also test protocol 0 on purpose, since it
          # should work (even though one should not use it).
          g = pickle.loads(pickle.dumps(f, protocol=0))
          g = pickle.loads(pickle.dumps(f, protocol=-1))
      except NotImplementedError as e:
          if e[0].startswith("DebugMode is not picklable"):
              return
          else:
              raise
      # if they both return, assume  that they return equivalent things.
      # print [(k,id(k)) for k in f.finder.keys()]
      # print [(k,id(k)) for k in g.finder.keys()]
  
      self.assertFalse(g.container[0].storage is f.container[0].storage)
      self.assertFalse(g.container[1].storage is f.container[1].storage)
      self.assertFalse(g.container[2].storage is f.container[2].storage)
      self.assertFalse(x in g.container)
      self.assertFalse(x in g.value)
  
      self.assertFalse(
          g.value[1] is f.value[1]
      )  # should not have been copied
      self.assertFalse(
          g.value[2] is f.value[2]
      )  # should have been copied because it is mutable.
      self.assertFalse(
          (g.value[2] != f.value[2]).any()
      )  # its contents should be identical
  
      self.assertTrue(
          f(2, 1) == g(2)
      )  # they should be in sync, default value should be copied.
      self.assertTrue(
          f(2, 1) == g(2)
      )  # they should be in sync, default value should be copied.
      f(1, 2)  # put them out of sync
      self.assertFalse(f(1, 2) == g(1, 2))
  
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 5 for calling the T_picklefunction obj's underlying member method code with example usage: obj.test_pickle() without return types