code: def decode_event(abi: ABI, log_: Dict) -> Dict:
      
      if isinstance(log_['topics'][0], str):
          log_['topics'][0] = decode_hex(log_['topics'][0])
      elif isinstance(log_['topics'][0], int):
          log_['topics'][0] = decode_hex(hex(log_['topics'][0]))
      event_id = log_['topics'][0]
      events = filter_by_type('event', abi)
      topic_to_event_abi = {
          event_abi_to_log_topic(event_abi): event_abi
          for event_abi in events
      }
      event_abi = topic_to_event_abi[event_id]
      return get_event_data(event_abi, log_)
docs: Helper function to unpack event data using a provided ABI
  
      Args:
          abi: The ABI of the contract, not the ABI of the event
          log_: The raw event data
  
      Returns:
          The decoded event