docs: def parse_rethinkdb_url(s):
      '''
      Parses a url like this rethinkdb://server1:port,server2:port/database/table
  
      Returns:
          tuple `(['server1:port', 'server2:port'], database, table)`
          `table` and `database` may be None
  
      Raises:
          ValueError if url cannot be parsed as a rethinkdb url
  
      There is some precedent for this kind of url (though only with a single
      host):
      - https://gist.github.com/lucidfrontier45/e5881a8fca25e51ab21c3cf4b4179daa
      - https://github.com/laggyluke/node-parse-rethinkdb-url
      '''
      result = ParsedRethinkDbUrl(None, None, None)
      parsed = urllib_parse.urlparse(s)
      if parsed.scheme != 'rethinkdb':
          raise ValueError
      hosts = parsed.netloc.split(',')
  
      database = None
      table = None
      path_segments = parsed.path.split('/')[1:]
      if len(path_segments) >= 3:
          raise ValueError
      if len(path_segments) >= 1:
          database = path_segments[0]
          if len(path_segments) == 2:
              table = path_segments[1]
  
      if '' in hosts or database == '' or table == '':
          raise ValueError
  
      if any('@' in host for host in hosts):
          raise ValueError
  
      return ParsedRethinkDbUrl(hosts, database, table)