code: 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)), beginf 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)
docs: do something in the directory.