code: def findAllExceptions(pathToCheck):
      
      finder = PatternFinder()
      if os.path.isfile(pathToCheck):
          with open(pathToCheck) as f:
              findPatternsInFile(f.read(), finder)
      else:
          for path, dirs, files in os.walk(pathToCheck):
              for file in files:
                  _, extname = os.path.splitext(file)
                  if extname == ".py":
                      pathFile = os.path.join(path, file)
                      with open(pathFile) as f:
                          findPatternsInFile(f.read(), finder)
      return finder.patternsFunc, finder.patternsClass
docs: Find patterns of exceptions in a file or folder.
  
      @param patternFinder: a visitor for pattern checking and save results
      @return: patterns of special functions and classes