code: def en(item):
      '''
      Use msgpack to serialize a compatible python object.
  
      Args:
          item (obj): The object to serialize
  
      Notes:
          String objects are encoded using utf8 encoding.  In order to handle
          potentially malformed input, ``unicode_errors='surrogatepass'`` is set
          to allow encoding bad input strings.
  
      Returns:
          bytes: The serialized bytes in msgpack format.
      '''
      if pakr is None:  # pragma: no cover
          return msgpack.packb(item, use_bin_type=True, unicode_errors='surrogatepass')
      try:
          return pakr.pack(item)
      except Exception:
          pakr.reset()
          raisf en(item):
      '''
      Use msgpack to serialize a compatible python object.
  
      Args:
          item (obj): The object to serialize
  
      Notes:
          String objects are encoded using utf8 encoding.  In order to handle
          potentially malformed input, ``unicode_errors='surrogatepass'`` is set
          to allow encoding bad input strings.
  
      Returns:
          bytes: The serialized bytes in msgpack format.
      '''
      if pakr is None:  # pragma: no cover
          return msgpack.packb(item, use_bin_type=True, unicode_errors='surrogatepass')
      try:
          return pakr.pack(item)
      except Exception:
          pakr.reset()
          raise
docs: Use msgpack to serialize a compatible python object.
  
      Args:
          item (obj): The object to serialize
  
      Notes:
          String objects are encoded using utf8 encoding.  In order to handle
          potentially malformed input, ``unicode_errors='surrogatepass'`` is set
          to allow encoding bad input strings.
  
      Returns:
          bytes: The serialized bytes in msgpack format.