def get_match_filter(barcode):
    """Return a function for filtering a pair of (seq, bc) namedtuple
    pairs; the function returns True if bc.seq == barcode

    """

    def filterfun(pair):
        seq, bc = pair
        return str(bc.seq) == barcode

    return filterfun