<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def CheckAddressState(self, script_hash):
 """ Determine the address state of the provided script hash. Args: script_hash (UInt160):
 a script hash to determine the address state of. Returns: AddressState: the address state. """

        for key, contract in self._contracts.items():
            if contract.ScriptHash.ToBytes() == script_hash.ToBytes():
                return AddressState.InWallet
        for watch in self._watch_only:
            if watch == script_hash:
                return AddressState.InWallet | AddressState.WatchOnly
        return AddressState.NoState