@open_connection<EOL>@reset_epoch<EOL>@parse_nds2_enums<EOL>def find_channels(channels, connection=None, host=None, port=None,<EOL>sample_rate=None, type=Nds2ChannelType.any(),<EOL>dtype=Nds2DataType.any(), unique=False, epoch='<STR_LIT>'):<EOL>
<EOL>if not isinstance(epoch, tuple):<EOL><INDENT>epoch = (epoch or '<STR_LIT>',)<EOL><DEDENT>connection.set_epoch(*epoch)<EOL>if isinstance(sample_rate, (int, float)):<EOL><INDENT>sample_rate = (sample_rate, sample_rate)<EOL><DEDENT>elif sample_rate is None:<EOL><INDENT>sample_rate = tuple()<EOL><DEDENT>out = []<EOL>for name in _get_nds2_names(channels):<EOL><INDENT>out.extend(_find_channel(connection, name, type, dtype, sample_rate,<EOL>unique=unique))<EOL><DEDENT>return out<EOL>
Query an NDS2 server for channel information

    Parameters
    ----------
    channels : `list` of `str`
        list of channel names to query, each can include bash-style globs

    connection : `nds2.connection`, optional
        open NDS2 connection to use for query

    host : `str`, optional
        name of NDS2 server to query, required if ``connection`` is not
        given

    port : `int`, optional
        port number on host to use for NDS2 connection

    sample_rate : `int`, `float`, `tuple`, optional
        a single number, representing a specific sample rate to match,
        or a tuple representing a ``(low, high)` interval to match

    type : `int`, optional
        the NDS2 channel type to match

    dtype : `int`, optional
        the NDS2 data type to match

    unique : `bool`, optional, default: `False`
        require one (and only one) match per channel

    epoch : `str`, `tuple` of `int`, optional
        the NDS epoch to restrict to, either the name of a known epoch,
        or a 2-tuple of GPS ``[start, stop)`` times

    Returns
    -------
    channels : `list` of `nds2.channel`
        list of NDS2 channel objects

    See also
    --------
    nds2.connection.find_channels
        for documentation on the underlying query method

    Examples
    --------
    >>> from gwpy.io.nds2 import find_channels
    >>> find_channels(['G1:DER_DATA_H'], host='nds.ligo.caltech.edu')
    [<G1:DER_DATA_H (16384Hz, RDS, FLOAT64)>]