human
Complete the below
def _AddStrMethod(message_descriptor, cls):

    ''''Helper for _AddMessageMethods().'
    '''
assistant
#Here is the Python code you requested.
    def __str__(self):
        return text_format.MessageToString(self)
    cls.__str__ = __str__