Removes a task.

            `env`
                Runtime ``Environment`` instance.
            `args`
                Arguments object from arg parser.
168895
def execute(self, env, args):
        

        # extract args
        task_name = args.task_name
        force = args.force

        if env.task.active and env.task.name == task_name:
            raise errors.ActiveTask

        if not env.task.exists(task_name):
            raise errors.TaskNotFound(task_name)

        if force:
            env.task.remove(task_name)

        else:
            try:
                while True:
                    prompt = ('Are you sure you want to delete "{0}" (y/n)? '
                              .format(task_name))
                    resp = env.io.prompt(prompt, newline=False).lower()

                    if resp in ('y', 'n'):
                        if resp == 'y':
                            env.task.remove(task_name)
                        break

            except KeyboardInterrupt:
                pass
1165668
def unset_os_environ(variables_mapping):
    
    for variable in variables_mapping:
        os.environ.pop(variable)
        logger.log_debug("Unset OS environment variable: {}".format(variable))
977314
def clean(func):
    
    def wrapper(*args, **kwargs):
        # tuple: output command, path given from command line,
        # path of templ file when you give the payload
        out, given_path, path = func(*args, **kwargs)

        try:
            if not given_path:
                os.remove(path)
        except OSError:
            pass

        return out

    return wrapper
1003520
def prune(force):
    """"""
    if not force:
        echo_warning(
            'Removing configuration of environments that may be in use will leave '
            'them in a potentially unusable state. If you wish to proceed (e.g. you '
            'have just restarted your machine), you may use the -f / --force flag.'
        )
        abort(code=2)

    checks = get_configured_checks()
    for check in checks:
        envs = get_configured_envs(check)

        if envs:
            echo_info('{}:'.format(check))
            for env in envs:
                echo_waiting('Removing `{}`... '.format(env), nl=False, indent=True)
                remove_env_data(check, env)
                echo_success('success!')

        remove_env_root(check)
230331
def close(self):
        """"""
        # make sure the environment hasn't already been closed
        if self._env is None:
            raise ValueError('env has already been closed.')
        # purge the environment from C++ memory
        _LIB.Close(self._env)
        # deallocate the object locally
        self._env = None
        # if there is an image viewer open, delete it
        if self.viewer is not None:
            self.viewer.close()
1061733
def remove_methods(self, env):
        
        for method in list(self.methods.values()):
            env.RemoveMethod(method)
1133602
def remove(path):
    '''
    
    '''
    try:
        os.remove(path)
    except OSError as exc:
        if exc.errno != errno.ENOENT:
            raise
861310
def remove_command(parameter):
    
    conf = get_config_obj()

    section = "cli"
    if "." in parameter:
        section, parameter = parameter.split(".", 1)

    # ensure that the section exists
    if section not in conf:
        conf[section] = {}
    # remove the value for the given parameter
    del conf[section][parameter]

    # write to disk
    safeprint("Writing updated config to {}".format(conf.filename))
    conf.write()
1008410
def uninstall(self):
        """"""
        if path.isdir(self.env_bin):
            self.remove_links()
        if path.isdir(self.env):
            print_pretty("<FG_BLUE>Removing env {}...<END>".format(self.env))
            shutil.rmtree(self.env)
467423
function clean(args) {
	return Array.prototype.filter.call(args, v => v !== INVALIDATE);
}
940487
def delete(args):
  """"""
  jm = setup(args)
  # first, stop the jobs if they are running in the grid
  if not args.local and 'executing' in args.status:
    stop(args)
  # then, delete them from the database
  jm.delete(job_ids=get_ids(args.job_ids), array_ids=get_ids(args.array_ids), delete_logs=not args.keep_logs, delete_log_dir=not args.keep_log_dir, status=args.status)
293598
def exec(self, args):
        

        logger.debug("remove %s", args.remove)

        for pkg in args.remove:
            logger.debug("removing %s", pkg)
            self.remove_repo(pkg)
521004
def delete(args):
    
    m = RiverManager(args.hosts)
    m.delete(args.name)
77068
def remove(self, task_cls):
		
		registry_tag = task_cls.__registry_tag__
		if registry_tag in self.__registry.keys():
			self.__registry[registry_tag] = \
				list(filter(lambda x: x != task_cls, self.__registry[registry_tag]))
			if len(self.__registry[registry_tag]) == 0:
				self.__registry.pop(registry_tag)
663288
def cleanup_environment():
    
    SERV.terminate()
    shutil.rmtree(TMP_PATH)
    if os.path.exists(TMP_PATH):
        os.rmdir(TMP_PATH)

    global TMP_PATH
    TMP_PATH = None
1333546
def remove_args(parser):
    '''  '''

    arguments = []
    for action in list(parser._get_optional_actions()):
        if '--help' not in action.option_strings:
            arguments += action.option_strings

    for arg in arguments:
        if arg in sys.argv:
            sys.argv.remove(arg)
1049913
def remove(self, task_name):
        

        try:
            task_dir = self._get_task_dir(task_name)
            shutil.rmtree(task_dir)
            return True

        except OSError:
            return False