def do_clean(args, env):
    with env.let(quiet=True):
        login.default_login()
        pubkey = keypair.default_keypair()
        manif = manifest.default_manifest(required=False)

    if manif is None and not args.all:
        error.raise_error('Project manifest ({0}) not found.\n'
                          'Cannot determine current project.\n'
                          "Use 'ravtest clean -a' to clean all projects.",
                          manifest.manifest_name())
    if args.all:
        project = None
    else:
        project = manif['project']['name']
        console.info('Project name is `{0}`.', project)
    
    if args.blueprint:
        objs = cache.find_blueprints(project)
        objs = filter(lambda app: app['state'] == 'DONE', objs)
        what = 'blueprint'
    else:
        objs = cache.find_applications(project)
        objs = filter(lambda app: app['totalStartedVms'] == 0, objs)
        what = 'application'

    count = len(objs)
    noun = inflect.plural_noun(what, count)
    if count == 0:
        console.info('There are no {0} to clean up.', noun)
        return 0

    if not env.always_confirm:
        console.warning('About to remove {0} {1}.', count, noun)
        console.warning('There is no way to undo this.')
        confirmed = console.confirm('Are you sure you want to continue?')
        if not confirmed:
            console.writeln('Not confirmed.')
            return 0

    for obj in objs:
        if args.blueprint:
            env.api.remove_blueprint(obj)
        else:
            env.api.remove_application(obj)

    verb = inflect.plural_verb('was', count)
    console.info('{0} {1} {2} succesfully removed.', count, noun, verb)
Return a pandas.DataFrame giving information about this table's
dataset/ETHPy150Open ravello/testmill/lib/testmill/command_clean.py/do_clean--crossover with--dataset/ETHPy150Open cloudera/ibis/ibis/impala/client.py/ImpalaTable.partitions