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

    """Helper for _AddMessageMethods().
    """
    def ClearField(self, field_name):
        try:
            field = message_descriptor.fields_by_name[field_name]
        except KeyError:
            raise ValueError(('Protocol    message    has    no    "%s"    field.' % field_name))
        if (field in self._fields):
            del self._fields[field]
        self._Modified()
    cls.ClearField = ClearField