code: def clean(all=False, docs=False, dist=False, extra=None):
      
  
      run('find . -type f -name "*.py[co]" -delete')
      run('find . -type d -name "__pycache__" -delete')
  
      patterns = ['build', '*.egg-info/']
      if all or docs:
          patterns.append('doc/build/*')
      if all or dist:
          patterns.append('dist')
      if extra:
          patterns.append(extra)
      for pattern in patterns:
          run('rm -rf {}'.format(pattern))
docs: Clean up build files