human
Write me a the Python program you requested given the following:
Complete the below
def _AddSerializePartialToStringMethod(message_descriptor, cls):

    ''''Helper for _AddMessageMethods().'
    '''
assistant
#Here is the Python program you requested.
    def SerializePartialToString(self):
        out = StringIO()
        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