code: def _parse_host(cls, host='localhost', port=0):
          
          if not port and (host.find(':') == host.rfind(':')):
              i = host.rfind(':')
              if i >= 0:
                  host, port = host[:i], host[i + 1:]
                  try:
                      port = int(port)
                  except ValueError:
                      raise OSError('nonnumeric port')
          return host, port
docs: Parse provided hostname and extract port number
  
          :param host: Server hostname
          :type host: string
          :param port: Server port
          :return: Tuple of (host, port)
          :rtype: tuple