code: def test_serialization(self):
      pickled_posonly = pickle.dumps(global_pos_only_f)
      pickled_optional = pickle.dumps(global_pos_only_and_normal)
      pickled_defaults = pickle.dumps(global_pos_only_defaults)
  
      unpickled_posonly = pickle.loads(pickled_posonly)
      unpickled_optional = pickle.loads(pickled_optional)
      unpickled_defaults = pickle.loads(pickled_defaults)
  
      self.assertEqual(unpickled_posonly(1, 2), (1, 2))
      expected = (
          r"global_pos_only_f\(\) got some positional-only arguments "
          r"passed as keyword arguments: 'a, b'"
      )
      with self.assertRaisesRegex(TypeError, expected):
          unpickled_posonly(a=1, b=2)
  
      self.assertEqual(unpickled_optional(1, 2), (1, 2))
      expected = (
          r"global_pos_only_and_normal\(\) got some positional-only arguments "
          r"passed as keyword arguments: 'a'"
      )
      with self.assertRaisesRegex(TypeError, expected):
          unpickled_optional(a=1, b=2)
  
      self.assertEqual(unpickled_defaults(), (1, 2))
      expected = (
          r"global_pos_only_defaults\(\) got some positional-only arguments "
          r"passed as keyword arguments: 'a'"
      )
      with self.assertRaisesRegex(TypeError, expected):
          unpickled_defaults(a=1, b=2)
  
imports: import dis
  import pickle
  import unittest
  from test.support import check_syntax_error
label_desc: Use image node_id 25 for calling the PositionalOnlyTestCase obj's underlying member method code with example usage: obj.test_serialization() without return types