def filter_pairs(pairs, max_len):
    """
    Filter pairs with either of the sentence > max_len tokens
    ==============
    Params:
    ==============
    pairs (list of tuples): each tuple is a src-target sentence pair
    max_len (Int): Max allowable sentence length
    """
    return [pair for pair in pairs if (len(pair[0].split()) <= max_len)]