<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def do_for_dir(inws, begin):
    '''
    do something in the directory.
    '''
    inws = os.path.abspath(inws)
    for wroot, wdirs, wfiles in os.walk(inws):
        for wfile in wfiles:
            if wfile.endswith('.html'):
                if 'autogen' in wroot:
                    continue
                check_html(os.path.abspath(os.path.join(wroot, wfile)), begin)