def clean(self):
    """ 'clean' provides a mechanism that will forcefully shut down all AppScale-
    related services on virtual machines in a cluster deployment.

    Returns:
      A list of the IP addresses where AppScale was shut down.

    Raises:
      AppScalefileException: If there is no AppScalefile in the current working
        directory.
      BadConfigurationException: If this method is invoked and the AppScalefile
        indicates that a cloud deployment is being used.
    """
    contents = self.read_appscalefile()

    contents_as_yaml = yaml.safe_load(contents)
    if 'ips_layout' not in contents_as_yaml:
      raise BadConfigurationException("Cannot use 'appscale clean' in a " \
        "cloud deployment.")

    if 'verbose' in contents_as_yaml and contents_as_yaml['verbose'] == True:
      is_verbose = contents_as_yaml['verbose']
    else:
      is_verbose = False

    if 'keyname' in contents_as_yaml:
      keyname = contents_as_yaml['keyname']
    else:
      keyname = 'appscale'

    all_ips = self.get_all_ips(contents_as_yaml["ips_layout"])

    if 'test' not in contents_as_yaml or contents_as_yaml['test'] != True:
      LocalState.ensure_user_wants_to_terminate()

    for ip in all_ips:
      RemoteHelper.ssh(ip, keyname, self.TERMINATE, is_verbose)

    LocalState.cleanup_appscale_files(keyname)
    AppScaleLogger.success("Successfully shut down your AppScale deployment.")
    return all_ips
dataset/ETHPy150Open AppScale/appscale-tools/lib/appscale.py/AppScale.clean/original