code: def test_broken_pickle_with_shared(self):
      saves = []
  
      def pers_save(obj):
          if isinstance(obj, np.ndarray):
              saves.append(obj)
              return len(saves) - 1
          else:
              return None
  
      def pers_load(id):
          return saves[id]
  
      b = np.random.rand(5, 4)
  
      x = theano.tensor.matrix()
      y = theano.shared(b)
  
      f = theano.function([x], theano.tensor.dot(x, y))
  
      from theano.compat import BytesIO
  
      fp = BytesIO()
      p = pickle.Pickler(fp, 2)
      p.persistent_id = pers_save
      try:
          p.dump(f)
      except NotImplementedError as e:
          if exc_message(e).startswith("DebugMode is not picklable"):
              return
          else:
              raise
      fp2 = BytesIO(fp.getvalue())
      fp.close()
      p = pickle.Unpickler(fp2)
      p.persistent_load = pers_load
      p.load()
      fp2.close()
  
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 8 for calling the T_picklefunction obj's underlying member method code with example usage: obj.test_broken_pickle_with_shared() and returns: saves, unknown, None