code: def host_resolution_order(ifo, env='NDSSERVER', epoch='now',
                            lookback=14*86400):
      
      hosts = []
      # if given environment variable exists, it will contain a
      # comma-separated list of host:port strings giving the logical ordering
      if env and os.getenv(env):
          hosts = parse_nds_env(env)
      # If that host fails, return the server for this IFO and the backup at CIT
      if to_gps('now') - to_gps(epoch) > lookback:
          ifolist = [None, ifo]
      else:
          ifolist = [ifo, None]
      for difo in ifolist:
          try:
              host, port = DEFAULT_HOSTS[difo]
          except KeyError:
              # unknown default NDS2 host for detector, if we don't have
              # hosts already defined (either by NDSSERVER or similar)
              # we should warn the user
              if not hosts:
                  warnings.warn('No default host found for ifo %r' % ifo)
          else:
              if (host, port) not in hosts:
                  hosts.append((host, port))
      return list(hosts)
docs: 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