human
I wrote the below code

    def sort(terms, O):
        return sorted(terms, key=(lambda term: O(term[0])), reverse=True)
    terms = _rec_list_terms(f, u, ())
    if (not terms):
        return [(((0,) * (u + 1)), K.zero)]
    if (order is None):
        return terms
    else:
        return sort(terms, monomial_key(order))

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def dmp_list_terms(f, u, K, order=None):