stop all Patronis, remove their data directory and cleanup the keys in etcd
1113
def after_feature(context, feature):
    
    context.pctl.stop_all()
    shutil.rmtree(os.path.join(context.pctl.patroni_path, 'data'))
    context.dcs_ctl.cleanup_service_tree()
    if feature.status == 'failed':
        shutil.copytree(context.pctl.output_dir, context.pctl.output_dir + '_failed')
697109
def _cleanup(self):
        '''
        
        '''
        if (hasattr(self, 'config')
           and self.config.get('support_archive')
           and os.path.exists(self.config['support_archive'])):
            self.out.warning('Terminated earlier, cleaning up')
            try:
                os.unlink(self.config['support_archive'])
            except Exception as err:
                log.debug(err)
                self.out.error('{} while cleaning up.'.format(err))
483589
def clear(self):
        
        all_keys = self._find_keys_raw(settings.THUMBNAIL_KEY_PREFIX)
        if all_keys:
            self._delete_raw(*all_keys)
352344
def remove(self, dist):
        """"""
        while dist.location in self.paths:
            self.paths.remove(dist.location)
            self.dirty = True
        Environment.remove(self, dist)
997224
def stop(self):
        
        if self._fd is not None:
            self._pollobj.unregister(self._fd)
            os.close(self._fd)
            self._fd = None
        self._sys_proc_fun = None
179029
def _cleanup():
    '''
    
    '''
    for inst in _ACTIVE[:]:
        res = inst.isalive()
        if res is not True:
            try:
                _ACTIVE.remove(inst)
            except ValueError:
                # This can happen if two threads create a new Terminal instance
                # It's harmless that it was already removed, so ignore.
                pass
1698
def cleanup(self):
        

        while self.inactive_timeout > 0:
            self.time = time.time()

            keys = []

            for key, client in self.clients.items.items():
                t = getattr(client, "active_at", 0)
                if t > 0 and self.time - t > self.inactive_timeout:
                    client.kwargs["link"].disconnect()
                    keys.append(key)

            for key in keys:
                self.log_debug("Removing client (inactive): %s" % key)
                del self.clients[key]

            time.sleep(1)
742767
def clear_dir(self):
        """"""
        for snapshot in output_utils.get_filenames(self.output_dir):
            if snapshot.endswith('.pkl'):
                os.remove(snapshot)
243776
def clear(self):
        """"""
        if lib.EnvDeleteActivation(self._env, ffi.NULL) != 1:
            raise CLIPSError(self._env)
958339
def cleanup():
    """"""
    for sck in list(Wdb._sockets):
        try:
            sck.close()
        except Exception:
            log.warn('Error in cleanup', exc_info=True)
842839
def clear(self):
        """"""
        super(Router, self).clear()
        for name in self.todo:
            filename = os.path.join(self.migrate_dir, name + '.py')
            os.remove(filename)
991592
def cleanup(output_root):
    """"""
    if os.path.exists(output_root):
        if os.path.isdir(output_root):
            rmtree(output_root)
        else:
            os.remove(output_root)
239430
def clear(self):
        """"""    
        self.sam |= KEY_WRITE
        for v in list(self.values()):
            del self[v.name]
        for k in list(self.subkeys()):
            self.del_subkey(k.name)
182005
def cli(ctx):
    """"""
    dir_path = os.path.join(os.path.expanduser('~'), '.keep')
    if os.path.exists(dir_path):
        if click.confirm('[CRITICAL] Remove everything inside ~/.keep ?', abort=True):
            shutil.rmtree(dir_path)
    utils.first_time_use(ctx)
860196
def clear(self):
        """"""
        for k in list(self.keys()):
            if k not in self.extrakeys:
                del self[k]
1210629
public function cleanup()
    {
        if ($this->option('force')) {
            $this->deleteDirs();
        } elseif ($this->confirm('Delete all subdirectories in migrations folder?', true)) {
            $this->deleteDirs();
        }
    }
1269129
def cleanup_files_on_ev3():
    """"""

    list = get_base_ev3dev_cmd() + ['cleanup']

    env = os.environ.copy()
    env["PYTHONUSERBASE"] = THONNY_USER_BASE
    proc = subprocess.Popen(list, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
                            universal_newlines=True, env=env)
    dlg = MySubprocessDialog(get_workbench(), proc, "Delete files in homedir on EV3", autoclose=False)
    dlg.wait_window()