code: def IsDirty(self, proto):
      
      if proto.dirty:
        return True
  
      for python_format, _, type_descriptor in itervalues(proto.GetRawData()):
        if python_format is not None and type_descriptor.IsDirty(python_format):
          proto.dirty = True
          return True
  
      return False
docs: Return and clear the dirty state of the python object.