Searches for a command of the passed-in type and if found removes it from the user's PLF.
1655
private static void removeDirective(
            String elementId, String attributeName, String type, IPerson person) {
        Document plf = (Document) person.getAttribute(Constants.PLF);
        Element node = plf.getElementById(elementId);
        if (node == null) return;

        Element editSet = null;

        try {
            editSet = getEditSet(node, plf, person, false);
        } catch (Exception e) {
            /*
             * we should never get here since we are calling getEditSet passing
             * create=false meaning that the only portion of that method that
             * tosses an exception will not be reached with this call. But if a
             * runtime exception somehow occurs we will log it so that we don't
             * lose the information.
             */
            LOG.error(e, e);
            return;
        }

        // if no edit set then the edit can't be there either
        if (editSet == null) return;

        Node child = editSet.getFirstChild();

        while (child != null) {
            if (child.getNodeName().equals(type)) {
                Attr attr = ((Element) child).getAttributeNode(Constants.ATT_NAME);
                if (attr != null && attr.getValue().equals(attributeName)) {
                    // we found it, remove it
                    editSet.removeChild(child);
                    break;
                }
            }
            child = child.getNextSibling();
        }
        // if that was the last on in the edit set then delete it
        if (editSet.getFirstChild() == null) node.removeChild(editSet);
    }
1313162
async function deleteUnspecifiedTypes(options) {
  const { outputDir, fontName, types } = options

  for (let ext of FONT_TYPES) {
    if (types.indexOf(ext) !== -1) { continue }

    let filepath = path.resolve(outputDir, `${ fontName }.${ ext }`)

    if (await fsAsync.exists(filepath)) {
      await fsAsync.unlink(filepath)
    }
  }
}
794566
public function clearCommand()
    {
        $startTimestamp = time();

        $path = FLOW_PATH_ROOT . 'Data/MagicWandStash';
        FileUtils::removeDirectoryRecursively($path);

        #################
        # Final Message #
        #################

        $endTimestamp = time();
        $duration = $endTimestamp - $startTimestamp;

        $this->renderHeadLine('Done');
        $this->renderLine('Cleanup successful in %s seconds', [$duration]);
    }
108717
function filter(unparsed) {
  var cmds = this.commands()
    , alias = this.finder.getCommandByName;
  var i, l = unparsed.length;
  for(i = 0;i < l;i++) {
    //console.log('unparsed filter %s', unparsed[i]);
    if(alias(unparsed[i], cmds)) {
      unparsed.splice(i, 1);
      i--;
      l--;
    }
  }
  //console.log('return %j', unparsed);
  return unparsed;
}
146435
function(obj) {
    if (obj.command === 't') {
      state[obj.batch] = true;
    } else if (obj.command === 'd') {
      delete state[obj.batch];
    } else if (obj.command === 'changes_complete') {
      changesComplete = true;
    }
  }
68037
def strip_prompt(self, *args, **kwargs):
        """"""
        a_string = super(JuniperBase, self).strip_prompt(*args, **kwargs)
        return self.strip_context_items(a_string)
197377
function addonsManager_clearSearchField() {
    var textbox = this.getElement({type: "search_textbox"});
    var cmdKey = utils.getEntity(this.dtds, "selectAllCmd.key");

    this._controller.keypress(textbox, cmdKey, {accelKey: true});
    this._controller.keypress(textbox, 'VK_DELETE', {});
  }
744390
def _remove_action_from_type(valid_actions: Dict[str, List[str]],
                                 type_: str,
                                 filter_function: Callable[[str], bool]) -> None:
        
        action_list = valid_actions[type_]
        matching_action_index = [i for i, action in enumerate(action_list) if filter_function(action)]
        assert len(matching_action_index) == 1, "Filter function didn't find one action"
        action_list.pop(matching_action_index[0])
108015
def remove(filter, type=nil)
      if(type)
        const = Splib.find_const(type)
        type = const unless const.nil?
      end
      @lock.synchronize do
        (type ? [@filters[type]] : @filters.values).each do |set|
          [:filters, :procs].each do |t|
            if(set[t])
              set[t].delete_if{|v| v == filter}
              set.delete(t) if set[t].empty?
            end
          end
        end
        @filters.delete_if{|k,v|v.empty?}
      end
      nil
    end
677291
def find_command(self, argv):
        
        search_args = argv[:]
        name = ''
        while search_args:
            if search_args[0].startswith('-'):
                name = '%s %s' % (name, search_args[0])
                raise ValueError('Invalid command %r' % name)
            next_val = search_args.pop(0)
            name = '%s %s' % (name, next_val) if name else next_val
            if name in self.commands:
                cmd_ep = self.commands[name]
                if hasattr(cmd_ep, 'resolve'):
                    cmd_factory = cmd_ep.resolve()
                else:
                    # NOTE(dhellmann): Some fake classes don't take
                    # require as an argument. Yay?
                    arg_spec = inspect.getargspec(cmd_ep.load)
                    if 'require' in arg_spec[0]:
                        cmd_factory = cmd_ep.load(require=False)
                    else:
                        cmd_factory = cmd_ep.load()
                return (cmd_factory, name, search_args)
        else:
            raise ValueError('Unknown command %r' % next(iter(argv), ''))
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)
1071374
protected function removeLaravelCommands(): void
    {
        $devCommands = ['AuthMake', 'ControllerMake', 'MiddlewareMake',
            'NotificationTable', 'ExceptionMake', 'SessionTable',
            'ChannelMake',
            'ConsoleMake',
            'EventGenerate',
            'EventMake',
            'ExceptionMake',
            'FactoryMake',
            'JobMake',
            'ListenerMake',
            'MailMake',
            'MiddlewareMake',
            'ModelMake',
            'NotificationMake',
            'ObserverMake',
            'PolicyMake',
            'ProviderMake',
            'TestMake',
            'RequestMake',
            'ResourceMake',
            'RuleMake',
            'SeederMake',
        ];

        array_map(function ($item) {
            unset($this->devCommands[$item]);
        }, $devCommands);

        $commands = ['Optimize',
            'OptimizeClear', 'ClearResets', 'RouteCache',
            'RouteClear',
            'RouteList', 'Preset', 'ViewCache',
            'ViewClear', 'Serve', 'StorageLink', ];
        array_map(function ($item) {
            unset($this->commands[$item]);
        }, $commands);
    }
1321042
def _filter_commands(ctx, commands=None):
    """"""
    lookup = getattr(ctx.command, 'commands', {})
    if not lookup and isinstance(ctx.command, click.MultiCommand):
        lookup = _get_lazyload_commands(ctx.command)

    if commands is None:
        return sorted(lookup.values(), key=lambda item: item.name)

    names = [name.strip() for name in commands.split(',')]
    return [lookup[name] for name in names if name in lookup]
166609
def filter_instance(inst, plist):
    

    if plist is not None:
        for pname in inst.properties.keys():
            if pname.lower() not in plist:
                del inst.properties[pname]
92038
def remove(name, **kwargs):
    '''
    
    '''

    cmd = 'sysrc -v'

    if 'file' in kwargs:
        cmd += ' -f '+kwargs['file']

    if 'jail' in kwargs:
        cmd += ' -j '+kwargs['jail']

    cmd += ' -x '+name

    sysrcs = __salt__['cmd.run'](cmd)
    if "sysrc: unknown variable" in sysrcs:
        raise CommandExecutionError(sysrcs)
    else:
        return name+" removed"
417302
function drop(type, callback) {
      if (arguments.length === 1)
        delete _[type];
      else {
        var fn = wm.get(callback), cb, i;
        if (fn) {
          wm['delete'](callback);
          drop(type, fn);
        } else {
          cb = get(type).cb;
          i = indexOf.call(cb, callback);
          if (~i) cb.splice(i, 1);
        }
      }
    }
466301
public void remove(CmsPublishedResource res) {

        remove(res.getStructureId(), res.getRootPath(), res.getType());
    }