Delete a registered DOI.

        If the PID is new then it's deleted only locally.
        Otherwise, also it's deleted also remotely.

        :returns: `True` if is deleted successfully.
422805
def delete(self):
        
        try:
            if self.pid.is_new():
                self.pid.delete()
            else:
                self.pid.delete()
                self.api.metadata_delete(self.pid.pid_value)
        except (DataCiteError, HttpError):
            logger.exception("Failed to delete in DataCite",
                             extra=dict(pid=self.pid))
            raise
        logger.info("Successfully deleted in DataCite",
                    extra=dict(pid=self.pid))
        return True
393022
def _delete(self, **kwargs):
        
        requests_params = self._handle_requests_params(kwargs)

        delete_uri = self._meta_data['uri']
        session = self._meta_data['bigip']._meta_data['icr_session']

        # Check the generation for match before delete
        force = self._check_force_arg(kwargs.pop('force', True))
        if not force:
            self._check_generation()

        response = session.delete(delete_uri, **requests_params)
        if response.status_code == 200:
            self.__dict__ = {'deleted': True}
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')
588117
def unassign(self):
        
        if self.object_uuid is None and self.object_type is None:
            return True

        try:
            with db.session.begin_nested():
                if self.is_redirected():
                    db.session.delete(Redirect.query.get(self.object_uuid))
                    # Only registered PIDs can be redirected so we set it back
                    # to registered
                    self.status = PIDStatus.REGISTERED
                self.object_type = None
                self.object_uuid = None
                db.session.add(self)
        except SQLAlchemyError:
            logger.exception("Failed to unassign object.".format(self),
                             extra=dict(pid=self))
            raise
        logger.info("Unassigned object from {0}.".format(self),
                    extra=dict(pid=self))
        return True
36331
def delete_den(self):
        '''
        
        '''
        keys = self.list_keys()
        for status, keys in six.iteritems(self.list_keys()):
            for key in keys[self.DEN]:
                try:
                    os.remove(os.path.join(self.opts['pki_dir'], status, key))
                    eload = {'result': True,
                             'act': 'delete',
                             'id': key}
                    self.event.fire_event(eload,
                                          salt.utils.event.tagify(prefix='key'))
                except (OSError, IOError):
                    pass
        self.check_minion_cache()
        return self.list_keys()
539880
def write_pid(self, pid):
        
        self.fpid.seek(0)
        self.fpid.truncate()
        self.fpid.write("%d" % pid)
        self.fpid.close()
        del self.fpid
535249
def delete(self, callback=None, errback=None):
        
        return self._rest.delete(self.data['id'], callback=callback, errback=errback)
1099769
def _delete(self, *args, **kwargs):
        
        response = requests.delete(*args, **kwargs)
        response.raise_for_status()
528442
def rm_empty_doi(d):
    
    logger_misc.info("enter remove_empty_doi")
    try:
        # Check each publication dictionary
        for pub in d['pub']:
            # If no identifier, then we can quit here. If identifier, then keep going.
            if 'identifier' in pub:
                if 'id' in pub['identifier'][0]:
                    # If there's a DOI id, but it's EMPTY
                    if pub['identifier'][0]['id'] in EMPTY:
                        del pub['identifier']
                else:
                    # If there's an identifier section, with no DOI id
                    del pub['identifier']
    except KeyError as e:
        # What else could go wrong?
        logger_misc.warn("remove_empty_doi: KeyError: publication key not found, {}".format(e))
    logger_misc.info("exit remove_empty_doi")
    return d
609755
def remove_uid(self, uid):
        
        for sid in self.get('uid2sid', uid):
            self.remove('sid2uid', sid, uid)
        self.delete('uid2sid', uid)
490298
def __rmpid(self):
        
        import tempfile
        d = tempfile.gettempdir()
        name = os.path.join(d, "hoverpy.%i.%i"%(self._proxyPort, self._adminPort))
        if os.path.exists(name):
            os.unlink(name)
            logging.debug("deleting %s"%name)
1086151
def delete(identifier):
    ''''''
    log.info('Deleting source "%s"', identifier)
    actions.delete_source(identifier)
    log.info('Deleted source "%s"', identifier)
736266
def delete(gandi, resource, background, force):
    
    ids = gandi.certificate.usable_ids(resource)

    if len(ids) > 1:
        gandi.echo('Will not delete, %s is not precise enough.' % resource)
        gandi.echo('  * cert : ' +
                   '\n  * cert : '.join([str(id_) for id_ in ids]))
        return

    if not force:
        proceed = click.confirm("Are you sure to delete the certificate %s?" %
                                resource)
        if not proceed:
            return

    result = gandi.certificate.delete(ids[0], background)
    return result
601057
async def delete(self, device, remove=True):
        
        device = self._find_device(device)
        if not self.is_handleable(device) or not device.is_loop:
            self._log.warn(_('not deleting {0}: unhandled device', device))
            return False
        if remove:
            await self.auto_remove(device, force=True)
        self._log.debug(_('deleting {0}', device))
        await device.delete()
        self._log.info(_('deleted {0}', device))
        return True
1023028
def is_valid_pid_to_be_updated(did):
    """"""
    return (
        is_existing_object(did)
        and not is_local_replica(did)
        and not is_archived(did)
        and not is_obsoleted(did)
    )
676909
def delete_scan(self, scan_id):
        

        if self.get_status(scan_id) == ScanStatus.RUNNING:
            return False
        self.scans_table.pop(scan_id)
        if len(self.scans_table) == 0:
            del self.data_manager
            self.data_manager = None
        return True
895182
def delete(self, rid, raise_on_error=True):
        
        return self.ds.delete(rid, raise_on_error)