code: def split_hostmask(hostmask):
      
      nick, _, host = hostmask.partition('@')
      nick, _, user = nick.partition('!')
      return nick, user or None, host or None
docs: Splits a nick@host string into nick and host.