human
Here's a good function header given the following:
I wrote the below code

    if new_indices:
        letters_above = pretty_indices.get('above', '')
        letters_below = pretty_indices.get('below', '')
        letters_general = pretty_indices.get('general', '')
        len_above = len(letters_above)
        len_below = len(letters_below)
        len_general = len(letters_general)
        def _i(number):
            try:
                return letters_below[number]
            except IndexError:
                return ('i_' + str((number - len_below)))
        def _a(number):
            try:
                return letters_above[number]
            except IndexError:
                return ('a_' + str((number - len_above)))
        def _p(number):
            try:
                return letters_general[number]
            except IndexError:
                return ('p_' + str((number - len_general)))
    aboves = []
    belows = []
    generals = []
    dummies = expr.atoms(Dummy)
    if (not new_indices):
        dummies = sorted(dummies, key=default_sort_key)
    a = i = p = 0
    for d in dummies:
        assum = d.assumptions0
        if assum.get('above_fermi'):
            if new_indices:
                sym = _a(a)
                a += 1
            l1 = aboves
        elif assum.get('below_fermi'):
            if new_indices:
                sym = _i(i)
                i += 1
            l1 = belows
        else:
            if new_indices:
                sym = _p(p)
                p += 1
            l1 = generals
        if new_indices:
            l1.append(Dummy(sym, **assum))
        else:
            l1.append(d)
    expr = expr.expand()
    terms = Add.make_args(expr)
    new_terms = []
    for term in terms:
        i = iter(belows)
        a = iter(aboves)
        p = iter(generals)
        ordered = _get_ordered_dummies(term)
        subsdict = {}
        for d in ordered:
            if d.assumptions0.get('below_fermi'):
                subsdict[d] = next(i)
            elif d.assumptions0.get('above_fermi'):
                subsdict[d] = next(a)
           ...

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

def substitute_dummies(expr, new_indices=False, pretty_indices={}):