:raises: :exc:`~dxpy.exceptions.DXError` if no project is associated with the object

        Permanently removes the associated remote object from the
        associated project.
172945
def remove(self, **kwargs):
        '''
        
        '''

        if self._proj is None:
            raise DXError("Remove called when a project ID was not associated with this object handler")

        dxpy.api.project_remove_objects(self._proj, {"objects": [self._dxid]},
                                        **kwargs)

        # Reset internal state
        self._dxid = None
        self._proj = None
        self._desc = {}
266721
def remove_instance(self):
        
        with fields.FieldLock(self.related_field):
            related_pks = self()
            for pk in related_pks:

                # get the real related field
                related_instance = self.related_field._model(pk)
                related_field = getattr(related_instance, self.related_field.name)

                # check if we have a dedicated remove method
                remover = getattr(related_field, '_related_remover', None)

                # then remove the instance from the related field
                if remover is not None:
                    # if we have a remover method, it wants the instance as argument
                    # (the related field may be a set/list/sorted_set)
                    getattr(related_field, remover)(self.instance._pk)
                else:
                    # no remover method, simple delete the field
                    related_field.delete()
387609
def delete_if_exists(self, **kwargs):
        
        try:
            self.get(**kwargs).blocking_delete()
            return True
        except ObjectDoesNotExist:
            return False
1188642
def delete_instance(self, credentials, name, **kwargs):
        """"""
        op_name = delete_instance(
            credentials, self.project, self.zone, name, **kwargs)

        return op_name
976478
def remove(self, name, **params):
        
        log = self._getparam('log', self._discard, **params)

        if name not in self.names:
            log.error("Attempt to remove %r which was never added", name)
            raise Exception("Command %r has never been added" % (name,))
        del self.names[name]
        rebuild = False
        for path in list(self.modules):
            if name in self.modules[path]:
                self.modules[path].remove(name)
            if len(self.modules[path]) == 0:
                del self.modules[path]
                rebuild = True
        if rebuild:
            self._build(name, **params)
1329811
def project_destroy(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/destroy' % object_id, input_params, always_retry=always_retry, **kwargs)
878167
def delete(self, project_status, params={}, **options): 
        
        path = "/project_statuses/%s" % (project_status)
        return self.client.delete(path, params, **options)
595785
def project_closed(self, project):
        

        for node in project.nodes:
            if node.id in self._nodes:
                del self._nodes[node.id]
498081
def delete_project(self, project_name):
        
        headers = {}
        params = {}
        resource = "/"

        (resp, header) = self._send("DELETE", project_name, None, resource, params, headers)
        return DeleteProjectResponse(header, resp)
31932
def object_exists_in_project(obj_id, proj_id):
    '''
    
    '''
    if obj_id is None:
        raise ValueError("Expected obj_id to be a string")
    if proj_id is None:
        raise ValueError("Expected proj_id to be a string")
    if not is_container_id(proj_id):
        raise ValueError('Expected %r to be a container ID' % (proj_id,))
    return try_call(dxpy.DXHTTPRequest, '/' + obj_id + '/describe', {'project': proj_id})['project'] == proj_id
883801
def delete_project(id=None, name=None):
    
    content = delete_project_raw(id, name)
    if content:
        return utils.format_json(content)
141114
def drop_project(project_name):
    
    conn, c = open_data_base_connection()
    # Need to delete all the run_tables before removing the project_table and the entry from the main_table
    run_table_name = project_name + '_run_table'

    c.execute("SELECT run_name FROM {}".format(run_table_name))
    run_names = np.array(c.fetchall()).squeeze(axis=1)

    # remove one run at a time
    for run in run_names:
        drop_run(project_name, run)

    c.execute("DROP TABLE IF EXISTS {}".format(run_table_name))

    # Remove the project row from main table
    c.execute("""DELETE FROM main_table WHERE project_name='{}'""".format(project_name))
    conn.commit()
    print("{} project deleted".format(project_name))
187597
def delete_project(self):
        
        if self.current_active_project:
            self.switch_to_plugin()
            path = self.current_active_project.root_path
            buttons = QMessageBox.Yes | QMessageBox.No
            answer = QMessageBox.warning(
                self,
                _("Delete"),
                _("Do you really want to delete <b>{filename}</b>?<br><br>"
                  "<b>Note:</b> This action will only delete the project. "
                  "Its files are going to be preserved on disk."
                  ).format(filename=osp.basename(path)),
                buttons)
            if answer == QMessageBox.Yes:
                try:
                    self.close_project()
                    shutil.rmtree(osp.join(path, '.spyproject'))
                except EnvironmentError as error:
                    QMessageBox.critical(
                        self,
                        _("Project Explorer"),
                        _("<b>Unable to delete <i>{varpath}</i></b>"
                          "<br><br>The error message was:<br>{error}"
                          ).format(varpath=path, error=to_text_string(error)))
1126825
def project_closing(self, project):
        

        yield from super().project_closing(project)
        # delete the Dynamips devices corresponding to the project
        tasks = []
        for device in self._devices.values():
            if device.project.id == project.id:
                tasks.append(asyncio.async(device.delete()))

        if tasks:
            done, _ = yield from asyncio.wait(tasks)
            for future in done:
                try:
                    future.result()
                except (Exception, GeneratorExit) as e:
                    log.error("Could not delete device {}".format(e), exc_info=1)
158506
def delete(self, **kwargs):
        
        if self._dxid is not None:
            return dxpy.api.app_delete(self._dxid, **kwargs)
        else:
            return dxpy.api.app_delete('app-' + self._name, alias=self._alias, **kwargs)
85673
def _unapply_xheaders(self) -> None:
        
        self.remote_ip = self._orig_remote_ip
        self.protocol = self._orig_protocol
386100
def deleteprojectmember(self, project_id, user_id):
        
        request = requests.delete(
            '{0}/{1}/members/{2}'.format(self.projects_url, project_id, user_id),
            headers=self.headers, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 200:
            return True