code: def get_by_contract(self, contract_hash):
          
          hash = contract_hash
          if isinstance(contract_hash, str) and len(contract_hash) == 40:
              hash = UInt160.ParseString(contract_hash)
  
          if not isinstance(hash, UInt160):
              raise Exception("Incorrect address format")
  
          contractlist_snapshot = self.db.prefixed_db(NotificationPrefix.PREFIX_CONTRACT).snapshot()
          results = []
  
          for val in contractlist_snapshot.iterator(prefix=bytes(hash.Data), include_key=False):
              if len(val) > 4:
                  try:
                      event = SmartContractEvent.FromByteArray(val)
                      results.append(event)
                  except Exception as e:
                      logger.error("could not parse event: %s %s" % (e, val))
          return results
docs: Look up a set of notifications by the contract they are associated with
          Args:
              contract_hash (UInt160 or str): hash of contract for notifications to be retreived
  
          Returns:
              list: a list of notifications