code: def gethost(self, default=None, errors='strict'):
          
          host = self.host
          if host is None or (not host and default is not None):
              return default
          elif host.startswith(self.LBRACKET) and host.endswith(self.RBRACKET):
              return _ip_literal(host[1:-1])
          elif host.startswith(self.LBRACKET) or host.endswith(self.RBRACKET):
              raise ValueError('Invalid host %r' % host)
          # TODO: faster check for IPv4 address?
          return _ipv4_address(host) or uridecode(host, 'utf-8', errors).lower()
docs: Return the decoded host subcomponent of the URI authority as a
          string or an :mod:`ipaddress` address object, or `default` if
          the original URI reference did not contain a host.