def sieve(self, name=None, sample_rate=None, sample_range=None,<EOL>exact_match=False, **others):
<EOL>if isinstance(name, Pattern):<EOL><INDENT>flags = name.flags<EOL>name = name.pattern<EOL><DEDENT>else:<EOL><INDENT>flags = <NUM_LIT:0><EOL><DEDENT>if exact_match:<EOL><INDENT>name = name if name.startswith(r'<STR_LIT>') else r"<STR_LIT>" % name<EOL>name = name if name.endswith(r'<STR_LIT>') else r"<STR_LIT>" % name<EOL><DEDENT>name_regexp = re.compile(name, flags=flags)<EOL>matched = list(self)<EOL>if name is not None:<EOL><INDENT>matched = [entry for entry in matched if<EOL>name_regexp.search(entry.name) is not None]<EOL><DEDENT>if sample_rate is not None:<EOL><INDENT>sample_rate = (sample_rate.value if<EOL>isinstance(sample_rate, units.Quantity) else<EOL>float(sample_rate))<EOL>matched = [entry for entry in matched if entry.sample_rate and<EOL>entry.sample_rate.value == sample_rate]<EOL><DEDENT>if sample_range is not None:<EOL><INDENT>matched = [entry for entry in matched if<EOL>sample_range[<NUM_LIT:0>] <= entry.sample_rate.value <=<EOL>sample_range[<NUM_LIT:1>]]<EOL><DEDENT>for attr, val in others.items():<EOL><INDENT>if val is not None:<EOL><INDENT>matched = [entry for entry in matched if<EOL>(hasattr(entry, attr) and<EOL>getattr(entry, attr) == val)]<EOL><DEDENT><DEDENT>return self.__class__(matched)<EOL>
Find all `Channels <Channel>` in this list matching the
        specified criteria.

        Parameters
        ----------
        name : `str`, or regular expression
            any part of the channel name against which to match
            (or full name if `exact_match=False` is given)
        sample_rate : `float`
            rate (number of samples per second) to match exactly
        sample_range : 2-`tuple`
            `[low, high]` closed interval or rates to match within
        exact_match : `bool`
            return channels matching `name` exactly, default: `False`

        Returns
        -------
        new : `ChannelList`
            a new `ChannelList` containing the matching channels