<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_channels(channels, connection=None, host=None, port=None, sample_rate=None, type=Nds2ChannelType.any(), dtype=Nds2DataType.any(), unique=False, epoch='ALL'):
 # pylint: disable=unused-argument,redefined-builtin """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 -------- [<G1:DER_DATA_H (16384Hz, RDS, FLOAT64)>] """

    # set epoch
    if not isinstance(epoch, tuple):
        epoch = (epoch or 'All',)
    connection.set_epoch(*epoch)

    # format sample_rate as tuple for find_channels call
    if isinstance(sample_rate, (int, float)):
        sample_rate = (sample_rate, sample_rate)
    elif sample_rate is None:
        sample_rate = tuple()

    # query for channels
    out = []
    for name in _get_nds2_names(channels):
        out.extend(_find_channel(connection, name, type, dtype, sample_rate,
                                 unique=unique))
    return out