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

    if field in self._fields:



      del self._fields[field]

      if self._oneofs.get(field.containing_oneof, None) is field:
        del self._oneofs[field.containing_oneof]




    self._Modified()

  cls.ClearField = ClearField
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/net/proto2/python/internal/python_message.py/_AddClearFieldMethod/swapped operands of `in`