human
I wrote the below code

    if ignore_errors:
        def onerror(*args):
            pass
    elif (onerror is None):
        def onerror(*args):
            raise
    try:
        if os.path.islink(path):
            raise OSError('Cannot    call    rmtree    on    a    symbolic    link')
    except OSError:
        onerror(os.path.islink, path, sys.exc_info())
        return
    names = []
    try:
        names = os.listdir(path)
    except os.error as err:
        onerror(os.listdir, path, sys.exc_info())
    for name in names:
        fullname = os.path.join(path, name)
        try:
            mode = os.lstat(fullname).st_mode
        except os.error:
            mode = 0
        if stat.S_ISDIR(mode):
            rmtree(fullname, ignore_errors, onerror)
        else:
            try:
                os.remove(fullname)
            except os.error as err:
                onerror(os.remove, fullname, sys.exc_info())
    try:
        os.rmdir(path)
    except os.error:
        onerror(os.rmdir, path, sys.exc_info())
    return

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

def rmtree(path, ignore_errors=False, onerror=None):