def host_resolution_order(ifo, env='<STR_LIT>', epoch='<STR_LIT>',<EOL>lookback=<NUM_LIT>*<NUM_LIT>):
hosts = []<EOL>if env and os.getenv(env):<EOL><INDENT>hosts = parse_nds_env(env)<EOL><DEDENT>if to_gps('<STR_LIT>') - to_gps(epoch) > lookback:<EOL><INDENT>ifolist = [None, ifo]<EOL><DEDENT>else:<EOL><INDENT>ifolist = [ifo, None]<EOL><DEDENT>for difo in ifolist:<EOL><INDENT>try:<EOL><INDENT>host, port = DEFAULT_HOSTS[difo]<EOL><DEDENT>except KeyError:<EOL><INDENT>if not hosts:<EOL><INDENT>warnings.warn('<STR_LIT>' % ifo)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if (host, port) not in hosts:<EOL><INDENT>hosts.append((host, port))<EOL><DEDENT><DEDENT><DEDENT>return list(hosts)<EOL>
Generate a logical ordering of NDS (host, port) tuples for this IFO

    Parameters
    ----------
    ifo : `str`
        prefix for IFO of interest
    env : `str`, optional
        environment variable name to use for server order,
        default ``'NDSSERVER'``. The contents of this variable should
        be a comma-separated list of `host:port` strings, e.g.
        ``'nds1.server.com:80,nds2.server.com:80'``
    epoch : `~gwpy.time.LIGOTimeGPS`, `float`, `str`
        GPS epoch of data requested
    lookback : `float`
        duration of spinning-disk cache. This value triggers defaulting to
        the CIT NDS2 server over those at the LIGO sites

    Returns
    -------
    hro : `list` of `2-tuples <tuple>`
        ordered `list` of ``(host, port)`` tuples