human
I wrote the below code

    import doctest
    if os.path.isfile(testpath):
        mo = re.match('(|.*/)applications/(?P<a>[^/]+)', testpath)
        if (not mo):
            die(('test    file    is    not    in    application    directory:    %s' % testpath))
        a = mo.group('a')
        c = f = None
        files = [testpath]
    else:
        (a, c, f) = parse_path_info(testpath)
        errmsg = ('invalid    test    path:    %s' % testpath)
        if (not a):
            die(errmsg)
        cdir = os.path.join('applications', a, 'controllers')
        if (not os.path.isdir(cdir)):
            die(errmsg)
        if c:
            cfile = os.path.join(cdir, (c + '.py'))
            if (not os.path.isfile(cfile)):
                die(errmsg)
            files = [cfile]
        else:
            files = glob.glob(os.path.join(cdir, '*.py'))
    for testfile in files:
        globs = env(a, import_models)
        ignores = globs.keys()
        execfile(testfile, globs)
        def doctest_object(name, obj):
            'doctest    obj    and    enclosed    methods    and    classes.'
            if (type(obj) in (types.FunctionType, type, ClassType, types.MethodType, types.UnboundMethodType)):
                globs = env(a, c=c, f=f, import_models=import_models)
                execfile(testfile, globs)
                doctest.run_docstring_examples(obj, globs=globs, name=('%s:    %s' % (os.path.basename(testfile), name)), verbose=verbose)
                if (type(obj) in (type, ClassType)):
                    for attr_name in dir(obj):
                        o = eval(('%s.%s' % (name, attr_name)), globs)
                        doctest_object(attr_name, o)
        for (name, obj) in globs.items():
            if ((name not in ignores) and ((f is None) or (f == name))):
                doctest_object(name, obj)

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

def test(testpath, import_models=True, verbose=False):