def filter_by_users(pairs, users_, verbose=False):
    """Filter the (u_id, l_id) by selecting those which have u_id \in users_."""
    filtered_pairs = []

    for u_id, l_id in pairs:
        if u_id in users_:
            filtered_pairs.append((u_id, l_id))

    count = len(filtered_pairs)

    total = len(pairs)
    if verbose:
        print('{} / {} = {:.2f}% sequences selected.'
              .format(count, total, count / total * 100.))

    return filtered_pairs