def isDBPort(host, port, db, timeout=10):
    if host in (RDFTURTLEFILE_HOSTNAME, RDFXMLFILE_HOSTNAME):
        return True
    # determine if postgres port
    t = 2
    while t < timeout:
        try:
            conn = urllib.request.urlopen("http://{0}:{1}/{2}/status".format(host, port or '80', db))
            return True # success but doesn't need password
        except __HOLE__:
            return False # success, this is really a postgres socket, wants user name
        except URLError:
            return False # something is there but not postgres
        except socket.timeout:
            t = t + 2  # relax - try again with longer timeout
    return False

# deferred rdflib import
dataset/ETHPy150Open Arelle/Arelle/arelle/plugin/xbrlDB/XbrlSemanticRdfDB.py/isDBPort