Delete a resource.

        :param pid: The HydroShare ID of the resource
517625
def deleteResource(self, pid):
        
        url = "{url_base}/resource/{pid}/".format(url_base=self.url_base,
                                                  pid=pid)

        r = self._request('DELETE', url)
        if r.status_code != 200:
            if r.status_code == 403:
                raise HydroShareNotAuthorized(('DELETE', url))
            elif r.status_code == 404:
                raise HydroShareNotFound((pid,))
            else:
                raise HydroShareHTTPException((url, 'DELETE', r.status_code))

        resource = r.json()
        assert(resource['resource_id'] == pid)
        return resource['resource_id']
1016461
def remove_data_flow(self, data_flow_id, destroy=True):
        
        if data_flow_id not in self._data_flows:
            raise AttributeError("The data_flow_id %s does not exist" % str(data_flow_id))

        self._data_flows[data_flow_id].parent = None
        return self._data_flows.pop(data_flow_id)
203222
def delete(self, resource, resource_id):
        '''
        
        '''

        service_def, resource_def, path = self._get_service_information(
            resource)
        delete_path = "{0}{1}/" . format(path, resource_id)
        return self.call(path=delete_path, method="delete")
45225
def is_obsoleted_by_pid(pid):
    
    return d1_gmn.app.models.ScienceObject.objects.filter(
        obsoleted_by__did=pid
    ).exists()
216355
def delete(self, ids):
        
        url = build_uri_with_ids('api/v3/ipv6/%s/', ids)
        return super(ApiIPv6, self).delete(url)
314795
protected function removePidFileByPid(int $pid) : bool
    {
        foreach ($this->pids as $pool => $poolPids) {
            foreach ($poolPids as $workerId => $workerPid) {
                if ($pid !== $workerPid) {
                    continue;
                }
                $pidFile = $this->runPath .'/'.$pool.'/'.$pid.'.pid';
                return $this->removePidFile($pidFile);
            }
        }
        return false;
    }
89938
def pid(self):
        """"""
        try:

            os.remove(self.pidfile)

        except IOError:

            if not os.path.isfile(self.pidfile):

                return None

            LOG.exception("Failed to clear pidfile {0}).".format(self.pidfile))
            sys.exit(exit.PIDFILE_INACCESSIBLE)
140748
protected static void destroyProcess(String pid, long sleeptimeBeforeSigkill,
                                    boolean inBackground) {
    terminateProcess(pid);
    sigKill(pid, false, sleeptimeBeforeSigkill, inBackground);
  }
196821
def kill(pid_file):
    
    try:
        with open(pid_file) as f:
            os.kill(int(f.read()), 9)
        os.remove(pid_file)
    except (IOError, OSError):
        return False
    return True
661198
public function actionDelete( $id, $pid ) {

		$model	= $this->modelService->getById( $id );
		$parent = $this->parentService->getById( $pid );

		if( isset( $model ) && isset( $parent ) ) {

			$address = $this->addressService->getById( $model->modelId );

			// Delete Address and Mappings
			$this->addressService->delete( $address, [ 'admin' => true ] );

			// Trigger Ajax Success
			return AjaxUtil::generateSuccess( Yii::$app->coreMessage->getMessage( CoreGlobal::MESSAGE_REQUEST ) );
		}

		// Trigger Ajax Failure
		return AjaxUtil::generateFailure( Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_FOUND ) );
	}
1142498
def free(cls, pid, connection):
        
        with cls._lock:
            LOGGER.debug('Freeing %s from pool %s', id(connection), pid)
            cls._ensure_pool_exists(pid)
            cls._pools[pid].free(connection)
759540
def delete(self, ids):
        
        url = build_uri_with_ids('api/v3/ipv4/%s/', ids)

        return super(ApiIPv4, self).delete(url)
318412
def delete_project(self, project):
        
        pid = project.pid

        # project deleted

        ds_project = self.get_project(pid)
        if ds_project is not None:
            self._delete_project(pid)

        return
1141159
def delete(self, id):
        
        id = self.as_id(id)
        response = self.http.delete(
            '%s/%s' % (self.api_url, id),
            auth=self.auth)
        response.raise_for_status()
668998
def _close_pidfile(self):
        """"""
        if self._pid_fd is not None:
            os.close(self._pid_fd)
        try:
            os.remove(self.pidfile)
        except OSError as ex:
            if ex.errno != errno.ENOENT:
                raise
331773
def delete(self, id):
        
        self.conn.cursor().execute("DELETE FROM WeRoBot WHERE id=%s", (id, ))
        self.conn.commit()
328783
public static base_response delete(nitro_service client, vrid resource) throws Exception {
		vrid deleteresource = new vrid();
		deleteresource.id = resource.id;
		deleteresource.all = resource.all;
		return deleteresource.delete_resource(client);
	}