@task(help=dict(<EOL>docs="<STR_LIT>",<EOL>backups="<STR_LIT>",<EOL>bytecode="<STR_LIT>",<EOL>dist="<STR_LIT>",<EOL>all="<STR_LIT>",<EOL>venv="<STR_LIT>",<EOL>tox="<STR_LIT>",<EOL>extra="<STR_LIT>",<EOL>))<EOL>def clean(_dummy_ctx, docs=False, backups=False, bytecode=False, dist=False, <EOL>all=False, venv=False, tox=False, extra='<STR_LIT>'): 
cfg = config.load()<EOL>notify.banner("<STR_LIT>")<EOL>venv_dirs = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>patterns = ['<STR_LIT>', '<STR_LIT>']<EOL>excludes = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>if docs or all:<EOL><INDENT>patterns.extend(['<STR_LIT>', '<STR_LIT>'])<EOL><DEDENT>if dist or all:<EOL><INDENT>patterns.append('<STR_LIT>')<EOL><DEDENT>if backups or all:<EOL><INDENT>patterns.extend(['<STR_LIT>'])<EOL><DEDENT>if bytecode or all:<EOL><INDENT>patterns.extend([<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>cfg.srcjoin('<STR_LIT>')[len(cfg.project_root)+<NUM_LIT:1>:],<EOL>])<EOL><DEDENT>if venv:<EOL><INDENT>patterns.extend([i + '<STR_LIT:/>' for i in venv_dirs])<EOL><DEDENT>if tox:<EOL><INDENT>patterns.append('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>excludes.append('<STR_LIT>')<EOL><DEDENT>if extra:<EOL><INDENT>patterns.extend(shlex.split(extra))<EOL><DEDENT>patterns = [antglob.includes(i) for i in patterns] + [antglob.excludes(i) for i in excludes]<EOL>if not venv:<EOL><INDENT>patterns.extend([antglob.excludes(i + '<STR_LIT:/>') for i in venv_dirs])<EOL><DEDENT>fileset = antglob.FileSet(cfg.project_root, patterns)<EOL>for name in fileset:<EOL><INDENT>notify.info('<STR_LIT>'.format(name))<EOL>if name.endswith('<STR_LIT:/>'):<EOL><INDENT>shutil.rmtree(os.path.join(cfg.project_root, name))<EOL><DEDENT>else:<EOL><INDENT>os.unlink(os.path.join(cfg.project_root, name))<EOL><DEDENT><DEDENT>
Perform house-keeping.