Deletes the specified container. If the container contains objects, the
        command will fail unless 'del_objects' is passed as True. In that case,
        each object will be deleted first, and then the container.
551586
def delete(self, container, del_objects=False):
        
        return self._manager.delete(container, del_objects=del_objects)
45181
def _dockerKill(containerName, action):
    
    running = containerIsRunning(containerName)
    if running is None:
        # This means that the container doesn't exist.  We will see this if the
        # container was run with --rm and has already exited before this call.
        logger.debug('The container with name "%s" appears to have already been '
                    'removed.  Nothing to '
                  'do.', containerName)
    else:
        if action in (None, FORGO):
            logger.debug('The container with name %s continues to exist as we '
                        'were asked to forgo a '
                      'post-job action on it.', containerName)
        else:
            logger.debug('The container with name %s exists. Running '
                        'user-specified defer functions.',
                         containerName)
            if running and action >= STOP:
                logger.debug('Stopping container "%s".', containerName)
                for attempt in retry(predicate=dockerPredicate):
                    with attempt:
                        subprocess.check_call(['docker', 'stop', containerName])
            else:
                logger.debug('The container "%s" was not found to be running.',
                            containerName)
            if action >= RM:
                # If the container was run with --rm, then stop will most likely
                # remove the container.  We first check if it is running then
                # remove it.
                running = containerIsRunning(containerName)
                if running is not None:
                    logger.debug('Removing container "%s".', containerName)
                    for attempt in retry(predicate=dockerPredicate):
                        with attempt:
                            subprocess.check_call(['docker', 'rm', '-f',
                                                   containerName])
                else:
                    logger.debug('Container "%s" was not found on the system.'
                                'Nothing to remove.',
                                 containerName)
555180
async def destroy(self, container = None):
        
        if container is None:
            container = RoutineContainer(self.scheduler)
        if self.queue is not None:
            await container.syscall_noreturn(syscall_removequeue(self.scheduler.queue, self.queue))
            self.queue = None
1126169
def delete_container(self, container):
        
        try:
            LOG.debug('delete_container() with %s is success.', self.driver)
            return self.driver.delete_container(container)
        except DriverException as e:
            LOG.exception('delete_container() with %s raised\
                            an exception %s.', self.driver, e)
184345
def delete_object(connection, container: str, object_meta_data: dict) -> None:
    
    connection.delete_object(container, object_meta_data['name'])
667257
def delete(self, *args, **kwargs):
        
        try:
            os.remove(self.file.file.name)
        # image does not exist
        except (OSError, IOError):
            pass
        super(Image, self).delete(*args, **kwargs)
482971
def delete(self, cluster):
        
        if cluster.name not in self.clusters:
            raise ClusterNotFound(
                "Unable to delete non-existent cluster %s" % cluster.name)
        del self.clusters[cluster.name]
545875
def container_remove_objects(object_id, input_params={}, always_retry=False, **kwargs):
    
    return DXHTTPRequest('/%s/removeObjects' % object_id, input_params, always_retry=always_retry, **kwargs)
1174742
public function delete()
    {
        $response = $this->api->request('DELETE', $this->absolutePath());

        switch ($response->getStatusCode()) {
            case 204:
                // Container removed.
                return;
            case 404:
                throw new ApiRequestFailedException('Container "'.$this->name().'" was not found.');
            case 409:
                throw new ApiRequestFailedException('Container must be empty.');
        }
    }
904766
async def delete(self, service_id: str) -> bool:
        

        await self.docker._query(
            "services/{service_id}".format(service_id=service_id), method="DELETE"
        )
        return True
1152354
def delete(self, handle):
        
        self._check_session()
        self._rest.delete_request('objects', str(handle))
242475
def delete_object(self, bucket, object_name):
        
        details = self._details(
            method=b"DELETE",
            url_context=self._url_context(bucket=bucket, object_name=object_name),
        )
        d = self._submit(self._query_factory(details))
        return d
358279
def delete_container_2(self, name):
        
        code, container = self.get_container(name)
        if code == httplib.NOT_FOUND:
            return True
        elif code != httplib.OK:
            self.logger.error("Container %s on %s not exists. %d", name, self._host, code)
            return False

        if container.status.Running:
            code, message = self.change_container(name)
            if code != httplib.OK:
                self.logger.error("Stop container %s on %s error, status code %d, message %s", name, self._host, code,
                                  objson.dumps(message))
                return False

        code, message = self.delete_container(name)
        if code != httplib.OK:
            self.logger.error("Delete container %s on %s error, status code %d, message %s", name, self._host, code,
                              objson.dumps(message))
            return False
        return True
268683
public void delete() {
        if (!file.delete()) {
            Storage.LOG.WARN("Failed to delete data file for object %s (%s).", getName(), file.getAbsolutePath());
        }
        if (!getPropertiesFile().delete()) {
            Storage.LOG.WARN("Failed to delete properties file for object %s (%s).",
                    getName(),
                    getPropertiesFile().getAbsolutePath());
        }
    }
387609
def delete_if_exists(self, **kwargs):
        
        try:
            self.get(**kwargs).blocking_delete()
            return True
        except ObjectDoesNotExist:
            return False
518205
def rm(name):
    
    path = get_existing_project_path(name)

    click.confirm(
        'Are you sure you want to delete project %s?' % name, abort=True)

    container_name = get_container_name(name)
    client = docker.Client()
    try:
        client.inspect_container(container_name)
    except docker.errors.NotFound:
        pass
    else:
        print("Removing container %s..." % container_name)
        client.remove_container(container_name, v=True, force=True)

    print("Removing %s..." % path)
    shutil.rmtree(path)
1003214
def delete_blob(call=None, kwargs=None):  # pylint: disable=unused-argument
    '''
    
    '''
    if kwargs is None:
        kwargs = {}

    if 'container' not in kwargs:
        raise SaltCloudSystemExit(
            'A container must be specified'
        )

    if 'blob' not in kwargs:
        raise SaltCloudSystemExit(
            'A blob must be specified'
        )

    storageservice = _get_block_blob_service(kwargs)

    storageservice.delete_blob(kwargs['container'], kwargs['blob'])
    return True