parameters: (message_descriptor, cls)
docstring: Helper for _AddMessageMethods().
docstring_summary: Helper for _AddMessageMethods().
docstring_tokens: Helper for _AddMessageMethods () .
function: def _AddSerializePartialToStringMethod(message_descriptor, cls):
    """Helper for _AddMessageMethods()."""
  
    def SerializePartialToString(self):
      out = BytesIO()
      self._InternalSerialize(out.write)
      return out.getvalue()
    cls.SerializePartialToString = SerializePartialToString
  
    def InternalSerialize(self, write_bytes):
      for field_descriptor, field_value in self.ListFields():
        field_descriptor._encoder(write_bytes, field_value)
      for tag_bytes, value_bytes in self._unknown_fields:
        write_bytes(tag_bytes)
        write_bytes(value_bytes)
    cls._InternalSerialize = InternalSerialize
function_tokens: def _AddSerializePartialToStringMethod ( message_descriptor , cls ) : def SerializePartialToString ( self ) : out = BytesIO ( ) self . _InternalSerialize ( out . write ) return out . getvalue ( ) cls . SerializePartialToString = SerializePartialToString def InternalSerialize ( self , write_bytes ) : for field_descriptor , field_value in self . ListFields ( ) : field_descriptor . _encoder ( write_bytes , field_value ) for tag_bytes , value_bytes in self . _unknown_fields : write_bytes ( tag_bytes ) write_bytes ( value_bytes ) cls . _InternalSerialize = InternalSerialize