code: def parse_nds_env(env='NDSSERVER'):
      
      hosts = []
      for host in os.getenv(env).split(','):
          try:
              host, port = host.rsplit(':', 1)
          except ValueError:
              port = None
          else:
              port = int(port)
          if (host, port) not in hosts:
              hosts.append((host, port))
      return hosts
docs: Parse the NDSSERVER environment variable into a list of hosts
  
      Parameters
      ----------
      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'``
  
      Returns
      -------
      hostiter : `list` of `tuple`
          a list of (unique) ``(str, int)`` tuples for each host:port
          pair