human
I wrote the below code

    if (order is None):
        order = lex
    if isinstance(order, Symbol):
        order = str(order)
    if isinstance(order, str):
        try:
            order = _monomial_key[order]
        except KeyError:
            raise ValueError(("supported    monomial    orderings    are    'lex',    'grlex'    and    'grevlex',    got    %r" % order))
    if hasattr(order, '__call__'):
        if (gens is not None):
            def _order(expr):
                return order(expr.as_poly(*gens).degree_list())
            return _order
        return order
    else:
        raise ValueError(('monomial    ordering    specification    must    be    a    string    or    a    callable,    got    %s' % order))

What's a good function header?

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

def monomial_key(order=None, gens=None):