Removes a system by id.
        Usage: sftpman rm {system_id}..
        For a list of system ids, see `sftpman ls available`.
964650
def command_rm(self, system_id, *system_ids):
        
        # Intentionally reading the first system_id separately,
        # because it's required. The others are optional.
        # This ensures that we'll generate an error if someone tries to call
        # this without the required argument.
        system_ids = (system_id,) + system_ids
        has_failed = False
        for system_id in system_ids:
            try:
                system = SystemModel.create_by_id(system_id, self.environment)
                controller = SystemControllerModel(system, self.environment)
                controller.unmount()
                system.delete(self.environment)
            except SftpException as e:
                sys.stderr.write('Cannot remove %s: %s\n' % (system_id, str(e)))
                has_failed = True
        if has_failed:
            sys.exit(1)
1143957
def remove(self, delete=True):
        
        if self.state >= library.MachineState.running:
            session = virtualbox.Session()
            self.lock_machine(session, library.LockType.shared)
            try:
                progress = session.console.power_down()
                progress.wait_for_completion(-1)
            except Exception:
                print("Error powering off machine", file=sys.stderr)
            session.unlock_machine()
            time.sleep(0.5)  # TODO figure out how to ensure session is really unlocked...

        settings_dir = os.path.dirname(self.settings_file_path)
        if delete:
            option = library.CleanupMode.detach_all_return_hard_disks_only
        else:
            option = library.CleanupMode.detach_all_return_none
        media = self.unregister(option)
        if delete:
            progress = self.delete_config(media)
            progress.wait_for_completion(-1)
            media = []

        # if delete - At some point in time virtualbox didn't do a full cleanup
        #             of this dir. Let's double check it has been cleaned up.
        if delete and os.path.exists(settings_dir):
            shutil.rmtree(settings_dir)

        return media
278108
function remove(conf) {
  var file = conf.get(ConfigKey.PIDFILE);
  // can be the empty string
  if(file) {
    log.notice('removing pid file %s', file);
    try {
      fs.unlinkSync(file);
    }catch(e) {
      log.warning('failed to remove pid file (%s): %s', file, e.message);
    }
  }
}
720783
def delete(self, ids):
        
        url = build_uri_with_ids('api/v4/equipment/%s/', ids)
        return super(ApiV4Equipment, self).delete(url)
61051
def delete(self, ids):
        
        url = build_uri_with_ids('api/v3/networkv6/%s/', ids)

        return super(ApiNetworkIPv6, self).delete(url)
944599
def run_remove_system(name, token, org, system, prompt):
    
    repo = get_repo(token=token, org=org, name=name)
    try:
        label = repo.get_label(name=system.strip())
        label.delete()
        click.secho("Successfully deleted {}".format(system), fg="green")
        if prompt and click.confirm("Run update to re-generate the page?"):
            run_update(name=name, token=token, org=org)
    except UnknownObjectException:
        click.secho("Unable to remove system {}, it does not exist.".format(system), fg="yellow")
1297373
def remove_container(self, container_id):
        
        self._docker.containers.get(container_id).remove(v=True, link=False, force=True)
1072265
def delete(self):
        
        target = DeviceTarget(self.device_id)
        return self._fssapi.delete_file(target, self.path)[self.device_id]
592483
def remove_sbi_id(self, sbi_id):
        """"""
        sbi_ids = self.sbi_ids
        sbi_ids.remove(sbi_id)
        DB.set_hash_value(self._key, 'sbi_ids', sbi_ids)
757018
def delete_by_id(self, del_id):
        '''
        
        '''
        if self.check_post_role()['DELETE']:
            pass
        else:
            return False
        if self.is_p:
            if MLink.delete(del_id):
                output = {'del_link': 1}
            else:
                output = {'del_link': 0}
            return json.dump(output, self)
        else:
            is_deleted = MLink.delete(del_id)
            if is_deleted:
                self.redirect('/link/list')
1033908
def remove_id(self,key):
        """"""
        self.infos.pop(key, "")
        new_l = [a for a in self if not (a.Id == key)]
        list.__init__(self, new_l)
101940
def remove_sid2uid(self, sid, uid):
        
        self.remove('uid2sid', uid, sid)
        self.remove('sid2uid', sid, uid)
660809
def rm(self, typ, id):
        
        return self._load(self._request(typ, id=id, method='DELETE'))
631917
def remove(id_):
    
    with LOCK:
        thread = REGISTRY.pop(id_, None)
        if thread is not None:
            thread.cancel()

    return thread
1038150
def delete(self, ids):
        
        url = build_uri_with_ids('api/v3/vlan/%s/', ids)

        return super(ApiVlan, self).delete(url)
138221
def remote_delete(self, remote_path, r_st):
        """"""
        # If it's a directory, then delete content and directory
        if S_ISDIR(r_st.st_mode):
            for item in self.sftp.listdir_attr(remote_path):
                full_path = path_join(remote_path, item.filename)
                self.remote_delete(full_path, item)
            self.sftp.rmdir(remote_path)

        # Or simply delete files
        else:
            try:
                self.sftp.remove(remote_path)
            except FileNotFoundError as e:
                self.logger.error(
                    "error while removing {}. trace: {}".format(remote_path, e)
                )
331773
def delete(self, id):
        
        self.conn.cursor().execute("DELETE FROM WeRoBot WHERE id=%s", (id, ))
        self.conn.commit()