def product_upper_triangle(values, include_diagonal=False):
 return all_pairs_matching_predicate(values, (operator.le if include_diagonal else operator.lt))

def product_upper_triangle ( values , include_diagonal = False ) : return all_pairs_matching_predicate ( values , ( operator . le if include_diagonal else operator . lt ) )
return an iterator over pairs .