Allow the minion to delete a specific function from its own mine
189457
def _mine_delete(self, load):
        '''
        
        '''
        if 'id' not in load or 'fun' not in load:
            return False
        if self.opts.get('minion_data_cache', False) or self.opts.get('enforce_mine_cache', False):
            cbank = 'minions/{0}'.format(load['id'])
            ckey = 'mine'
            try:
                data = self.cache.fetch(cbank, ckey)
                if not isinstance(data, dict):
                    return False
                if load['fun'] in data:
                    del data[load['fun']]
                    self.cache.store(cbank, ckey, data)
            except OSError:
                return False
        return True
961772
def force_delete(func, path, exc_info):
    
    os.chmod(path, stat.S_IWRITE)
    func(path)
1284512
def dispatch(self, *args, **kwargs):
        """"""
        return super(BreedingDelete, self).dispatch(*args, **kwargs)
989866
def removeFunction(self):
        
        root = self.etree
        t_execute = root.find('execute')
        try:
            root.remove(t_execute)
            return True
        except (Exception,) as e:
            print(e)

        return False
257665
def remove_readonly(func, path, _):
    ""
    os.chmod(path, stat.S_IWRITE)
    func(path)
495046
def delete(*args):
    ''''''
    from syn.base_utils import this_module
    mod = this_module(npop=3)
    yield
    for arg in args:
        name = arg
        if not isinstance(name, STR):
            name = arg.__name__
        delattr(mod, name)
1159730
def replace_cleanup_func(self, func, only_read=False):
        
        self.logger.info('Replace the cleanup function %s ---> %s' % (
            get_function_signature(self.cleanup), get_function_signature(func)))
        self.cleanup = func
        return True
581291
def shutdown(self, exitcode=0, exitmsg=None):
        '''
        
        '''
        if hasattr(self, 'minion') and 'proxymodule' in self.minion.opts:
            proxy_fn = self.minion.opts['proxymodule'].loaded_base_name + '.shutdown'
            self.minion.opts['proxymodule'][proxy_fn](self.minion.opts)
        self.action_log_info('Shutting down')
        super(ProxyMinion, self).shutdown(
            exitcode, ('The Salt {0} is shutdown. {1}'.format(
                self.__class__.__name__, (exitmsg or '')).strip()))
907550
def remove_hook(self, name, func):
        '''  '''
        if name in self._hooks and func in self._hooks[name]:
            self._hooks[name].remove(func)
            return True
545732
def off(  # pylint: disable=keyword-arg-before-vararg
            self, event: str = None, *handlers: T.Callable
    ) -> None:
        """"""

        if not event:
            self._events.clear()
            return

        if event not in self._events:
            raise EventNotFound(event)

        if not handlers:
            self._events.pop(event)
            return

        for callback in handlers:
            if callback not in self._events[event]:
                raise HandlerNotFound(event, callback)
            while callback in self._events[event]:
                self._events[event].remove(callback)
        return
1025085
def unbind(self, func, etype):
        '''
        
        '''
        i= self.event_funcs[etype].index(func)
        del self.event_funcs[etype][i]
1164693
def bust_self(self, obj):
        
        if self.func.__name__ in obj.__dict__:
            delattr(obj, self.func.__name__)
757406
function performRemove() {
        ClientModelDocService.remove(vm.clientModelDoc)
          .then(deleteClientModelDocSuccess)
          .catch(deleteClientModelDocCatch);

        function deleteClientModelDocSuccess() {
          Toast.show({type: 'success', text: 'ClientModelDoc ' + vm.displayName + ' deleted'});
          vm.showList();
        }

        function deleteClientModelDocCatch(err) {
          Toast.show({
            type: 'warn',
            text: 'Error while deleting clientModelDoc ' + vm.displayName,
            link: {state: $state.$current, params: $stateParams}
          });

          if (form && err) {
            form.setResponseErrors(err, vm.errors);
          }
        }
      }
365
def delete(self, **params):
        """"""
        d = self.request('delete', self.instance_url(), params)
        return d.addCallback(self.refresh_from).addCallback(lambda _: self)
639086
def delete_show_function(self, show_name):
        
        if self.get_show_function(show_name) is None:
            return

        self.shows.__delitem__(show_name)
146051
def function(self, fun, *args, **kwargs):
        '''
        
        '''
        func = self.sminion.functions[fun]
        args, kwargs = salt.minion.load_args_and_kwargs(
            func,
            salt.utils.args.parse_input(args, kwargs=kwargs),)
        return func(*args, **kwargs)
1302111
def clear_instance_cache(cls, func):
        

        @functools.wraps(func)
        def func_wrapper(*args, **kwargs):
            if not args:
                raise ValueError('`self` is not available.')
            else:
                the_self = args[0]

            cls.clear_self_cache(the_self)
            return func(*args, **kwargs)

        return func_wrapper