human
Complete this python program:
def _AddStrMethod(message_descriptor, cls):
assistant
#Here is the Python code you requested.

    """Helper for _AddMessageMethods().
    """
    def __str__(self):
        return text_format.MessageToString(self)
    cls.__str__ = __str__