code: def input_dir(dirname):
      
      dirname = dirname.rstrip('/')
      if excluded(dirname):
          return 0
      errors = 0
      for root, dirs, files in os.walk(dirname):
          if options.verbose:
              message('directory ' + root)
          options.counters['directories'] = \
              options.counters.get('directories', 0) + 1
          dirs.sort()
          for subdir in dirs:
              if excluded(subdir):
                  dirs.remove(subdir)
          files.sort()
          for filename in files:
              errors += input_file(os.path.join(root, filename))
      return errors
docs: Check all Python source files in this directory and all subdirectories.