code: def test_can_partial_buffers():
      def foo(arg1, arg2, kwarg1, kwarg2):
          return f"{arg1}{arg2[:32]}{b2a_hex(kwarg1.tobytes()[:32])}{kwarg2}"
  
      buf1 = os.urandom(1024 * 1024)
      buf2 = memoryview(os.urandom(1024 * 1024))
      partial_foo = partial(foo, 5, buf1, kwarg1=buf2, kwarg2=10)
      canned = can(partial_foo)
      assert len(canned.buffers) == 2
      assert isinstance(canned, canning.CannedPartial)
      buffers, canned.buffers = canned.buffers, []
      dumped = pickle.dumps(canned)
      loaded = pickle.loads(dumped)
      loaded.buffers = buffers
      pfoo2 = uncan(loaded)
      assert pfoo2() == partial_foo()
  
file_path: ipyparallel/ipyparallel/tests/test_canning.py
imports: import os
  import pickle
  from binascii import b2a_hex
  from functools import partial
  from ipyparallel.serialize import canning
  from ipyparallel.serialize.canning import can, uncan
label_desc: Use image node_id 11 for calling a global function with example usage: test_can_partial_buffers() and returns: arg1, arg2, b2a_hex, kwarg2