human
I wrote the below code

    ip = get_ipython()
    ip.ex('a=list(range(5))')
    (_, c) = ip.complete('.', line='a[0].')
    nt.assert_false(('.real' in c), ("Shouldn't    have    completed    on    a[0]:    %s" % c))
    with greedy_completion():
        with provisionalcompleter():
            def _(line, cursor_pos, expect, message, completion):
                (_, c) = ip.complete('.', line=line, cursor_pos=cursor_pos)
                with provisionalcompleter():
                    completions = ip.Completer.completions(line, cursor_pos)
                nt.assert_in(expect, c, (message % c))
                nt.assert_in(completion, completions)
            (yield (_, 'a[0].', 5, 'a[0].real', 'Should    have    completed    on    a[0].:    %s', Completion(5, 5, 'real')))
            (yield (_, 'a[0].r', 6, 'a[0].real', 'Should    have    completed    on    a[0].r:    %s', Completion(5, 6, 'real')))
            if (sys.version_info > (3, 4)):
                (yield (_, 'a[0].from_', 10, 'a[0].from_bytes', 'Should    have    completed    on    a[0].from_:    %s', Completion(5, 10, 'from_bytes')))

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

def test_greedy_completions():