@classmethod<EOL><INDENT>def fetch(cls, channels, start, end, host=None, port=None,<EOL>verify=False, verbose=False, connection=None,<EOL>pad=None, scaled=None, allow_tape=None, type=None,<EOL>dtype=None):<DEDENT>
from ..io import nds2 as io_nds2<EOL>from .io.nds2 import (print_verbose, fetch)<EOL>if dtype is None:<EOL><INDENT>dtype = {}<EOL><DEDENT>if connection is None and host is not None:<EOL><INDENT>print_verbose("<STR_LIT>".format(host),<EOL>end='<STR_LIT:U+0020>', verbose=verbose)<EOL>connection = io_nds2.auth_connect(host, port)<EOL>print_verbose('<STR_LIT>', verbose=verbose)<EOL><DEDENT>elif connection is None:<EOL><INDENT>ifos = set([Channel(channel).ifo for channel in channels])<EOL>if len(ifos) == <NUM_LIT:1>:<EOL><INDENT>ifo = list(ifos)[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>ifo = None<EOL><DEDENT>hostlist = io_nds2.host_resolution_order(ifo, epoch=start)<EOL>if allow_tape is None:<EOL><INDENT>tapes = [False, True]<EOL><DEDENT>else:<EOL><INDENT>tapes = [allow_tape]<EOL><DEDENT>for allow_tape_ in tapes:<EOL><INDENT>error = "<STR_LIT>"  <EOL>for host_, port_ in hostlist:<EOL><INDENT>try:<EOL><INDENT>return cls.fetch(channels, start, end, host=host_,<EOL>port=port_, verbose=verbose,<EOL>type=type, dtype=dtype, pad=pad,<EOL>scaled=scaled, allow_tape=allow_tape_)<EOL><DEDENT>except (RuntimeError, ValueError) as exc:<EOL><INDENT>error = str(exc)  <EOL>warnings.warn(error.split('<STR_LIT:\n>', <NUM_LIT:1>)[<NUM_LIT:0>],<EOL>io_nds2.NDSWarning)<EOL><DEDENT><DEDENT>if not allow_tape_ and '<STR_LIT>' in error:<EOL><INDENT>continue<EOL><DEDENT>if len(channels) > <NUM_LIT:1>:<EOL><INDENT>return cls(<EOL>(c, cls.EntryClass.fetch(c, start, end,<EOL>verbose=verbose, type=type,<EOL>verify=verify,<EOL>dtype=dtype.get(c), pad=pad,<EOL>scaled=scaled,<EOL>allow_tape=allow_tape_))<EOL>for c in channels)<EOL><DEDENT><DEDENT>err = "<STR_LIT>"<EOL>if not verbose:<EOL><INDENT>err += ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>raise RuntimeError(err)<EOL><DEDENT>start = to_gps(start)<EOL>end = to_gps(end)<EOL>istart = int(start)<EOL>iend = int(ceil(end))<EOL>return fetch(channels, istart, iend, connection=connection,<EOL>host=host, port=port, verbose=verbose, type=type,<EOL>dtype=dtype, pad=pad, allow_tape=allow_tape,<EOL>scaled=scaled,<EOL>series_class=cls.EntryClass).crop(start, end)<EOL>
Fetch data from NDS for a number of channels.

        Parameters
        ----------
        channels : `list`
            required data channels.

        start : `~gwpy.time.LIGOTimeGPS`, `float`, `str`
            GPS start time of required data,
            any input parseable by `~gwpy.time.to_gps` is fine

        end : `~gwpy.time.LIGOTimeGPS`, `float`, `str`, optional
            GPS end time of required data, defaults to end of data found;
            any input parseable by `~gwpy.time.to_gps` is fine

        host : `str`, optional
            URL of NDS server to use, if blank will try any server
            (in a relatively sensible order) to get the data

        port : `int`, optional
            port number for NDS server query, must be given with `host`.

        verify : `bool`, optional, default: `True`
            check channels exist in database before asking for data

        verbose : `bool`, optional
            print verbose output about NDS download progress, if ``verbose``
            is specified as a string, this defines the prefix for the
            progress meter

        connection : `nds2.connection`, optional
            open NDS connection to use.

        scaled : `bool`, optional
            apply slope and bias calibration to ADC data, for non-ADC data
            this option has no effect.

        allow_tape : `bool`, optional
            allow data access from slow tapes. If `host` or `connection` is
            given, the default is to do whatever the server default is,
            otherwise servers will be searched in logical order allowing tape
            access if necessary to retrieve the data

        type : `int`, `str`, optional
            NDS2 channel type integer or string name.

        dtype : `numpy.dtype`, `str`, `type`, or `dict`
            numeric data type for returned data, e.g. `numpy.float`, or
            `dict` of (`channel`, `dtype`) pairs

        Returns
        -------
        data : :class:`~gwpy.timeseries.TimeSeriesBaseDict`
            a new `TimeSeriesBaseDict` of (`str`, `TimeSeries`) pairs fetched
            from NDS.