def clean_output(cwd):
  """Cleans all build-related output and caches.

  Args:
    cwd: Current working directory.

  Returns:
    True if the clean succeeded.
  """
  nuke_paths = [
      '.build-cache',
      'build-out',
      'build-gen',
      'build-bin',
      ]
  any_failed = False
  for path in nuke_paths:
    full_path = os.path.join(cwd, path)
    if os.path.isdir(full_path):
      try:
        shutil.rmtree(full_path)
      except Exception as e:
        print 'Unable to remove %s: %s' % (full_path, e)
        any_failed = True
  return not any_failed
dataset/ETHPy150Open google/anvil-build/anvil/commands/util.py/clean_output/original