code: def GetHostname(self, event, default_hostname='-'):
      
      hostname = getattr(event, 'hostname', None)
      if hostname:
        return hostname
  
      session_identifier = event.GetSessionIdentifier()
      if session_identifier is None:
        return default_hostname
  
      hostname = self._knowledge_base.GetHostname(
          session_identifier=session_identifier)
      return hostname or default_hostname
docs: Retrieves the hostname related to the event.
  
      Args:
        event (EventObject): event.
        default_hostname (Optional[str]): default hostname.
  
      Returns:
        str: hostname.