<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def AddContract(self, contract):
 """ Add a contract to the wallet. Args: contract (Contract):
 a contract of type neo.SmartContract.Contract. Raises: Exception: Invalid operation - public key mismatch. """

        if not contract.PublicKeyHash.ToBytes() in self._keys.keys():
            raise Exception('Invalid operation - public key mismatch')

        self._contracts[contract.ScriptHash.ToBytes()] = contract
        if contract.ScriptHash in self._watch_only:
            self._watch_only.remove(contract.ScriptHash)