def cleanDir(dirName, pattern="*.prep", recursive=1, verbose=1):
    if verbose: print 'cleaning directory %s' % dirName
    if recursive:
        def _visit(A,D,N,pattern=pattern,verbose=verbose):
            _cleanFiles(filter(lambda fn,pattern=pattern: fnmatch(fn,pattern),
                    filter(os.path.isfile,map(lambda n, D=D: os.path.join(D,n),N))),verbose)
        os.path.walk(dirName,_visit,None)
    else:
        import glob
        _cleanFiles(filter(os.path.isfile,glob.glob(os.path.join(dirName, pattern))),verbose)
Return result for test suite.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/preppy.py/cleanDir--crossover with--dataset/ETHPy150Open python-hospital/hospital/hospital/cli.py/HealthCheckProgram.run_tests