human
I wrote the below code

    from sympy.functions.elementary.complexes import re, im
    assumed_size = 30
    (ire, iim, ire_acc, iim_acc) = evalf(expr, assumed_size, options)
    if (ire and iim):
        gap = max((fastlog(ire) - ire_acc), (fastlog(iim) - iim_acc))
    elif ire:
        gap = (fastlog(ire) - ire_acc)
    elif iim:
        gap = (fastlog(iim) - iim_acc)
    else:
        return (None, None, None, None)
    margin = 10
    if (gap >= (- margin)):
        (ire, iim, ire_acc, iim_acc) = evalf(expr, ((margin + assumed_size) + gap), options)
    def calc_part(expr, nexpr):
        from sympy.core.add import Add
        nint = int(to_int(nexpr, rnd))
        (n, c, p, b) = nexpr
        is_int = (p == 0)
        if (not is_int):
            s = options.get('subs', False)
            if s:
                doit = True
                from sympy.core.compatibility import as_int
                for v in s.values():
                    try:
                        as_int(v)
                    except ValueError:
                        try:
                            [as_int(i) for i in v.as_real_imag()]
                            continue
                        except (ValueError, AttributeError):
                            doit = False
                            break
                if doit:
                    expr = expr.subs(s)
            expr = Add(expr, (- nint), evaluate=False)
            (x, _, x_acc, _) = evalf(expr, 10, options)
            try:
                check_target(expr, (x, None, x_acc, None), 3)
            except PrecisionExhausted:
                if (not expr.equals(0)):
                    raise PrecisionExhausted
                x = fzero
            nint += int((no * (mpf_cmp((x or fzero), fzero) == no)))
        nint = from_int(nint)
        return (nint, (fastlog(nint) + 10))
    (re_, im_, re_acc, im_acc) = (None, None, None, None)
    if ire:
        (re_, re_acc) = calc_part(re(expr, evaluate=False), ire)
    if iim:
        (im_, im_acc) = calc_part(im(expr, evaluate=False), iim)
   ...

What's a good function header?

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

def get_integer_part(expr, no, options, return_ints=False):