Filter the command so that it no longer contains passwords
779441
def sanitize_args(cmd: List[str]) -> List[str]:
    
    sanitized = []
    for idx, fieldname in enumerate(cmd):
        def _is_password(cmdstr):
            return 'wifi-sec.psk' in cmdstr\
                or 'password' in cmdstr.lower()
        if idx > 0 and _is_password(cmd[idx-1]):
            sanitized.append('****')
        else:
            sanitized.append(fieldname)
    return sanitized
827871
def strip_key_strings(pofile):
    
    newlist = [entry for entry in pofile if not is_key_string(entry.msgid)]
    del pofile[:]
    pofile += newlist
1366017
def clean(self):
        ''''''
        data = super(PasswordMixin, self).clean()
        if 'password' in data and 'confirm_password' in data:
            if data['password'] != data['confirm_password']:
                raise ValidationError(_('Passwords do not match.'))
        return data
393252
def del_password(name, root=None):
    '''
    
    '''
    cmd = ['passwd']
    if root is not None:
        cmd.extend(('-R', root))
    cmd.extend(('-d', name))

    __salt__['cmd.run'](cmd, python_shell=False, output_loglevel='quiet')
    uinfo = info(name, root=root)
    return not uinfo['passwd'] and uinfo['name'] == name
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;
}
908093
private function zRemovePemFiles()
    {
        if (is_file($this->pubKeyFile)) {
            unlink($this->pubKeyFile);
        }
        if (is_file($this->priKeyFile)) {
            unlink($this->priKeyFile);
        }
        if (is_file($this->certKeyFile)) {
            unlink($this->certKeyFile);
        }
    }
1163087
def delete(*keys, **connection_args):
    '''
    
    '''
    # Get connection args from keywords if set
    conn_args = {}
    for arg in ['host', 'port', 'db', 'password']:
        if arg in connection_args:
            conn_args[arg] = connection_args[arg]

    server = _connect(**conn_args)
    return server.delete(*keys)
1308578
def _strip_auth(self, proc_params):
        """"""
        params = proc_params.copy()
        params.pop("auth", None)
        params.pop("clusterAuthMode", None)
        return 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);
    }
1053200
def hide_auth(msg):
    """"""
    for pattern, repl in RE_HIDE_AUTH:
        msg = pattern.sub(repl, msg)

    return msg
667572
def commandstr(command):
    """"""
    if command == CMD_MESSAGE_ERROR:
        msg = "CMD_MESSAGE_ERROR"
    elif command == CMD_MESSAGE_LIST:
        msg = "CMD_MESSAGE_LIST"
    elif command == CMD_MESSAGE_PASSWORD:
        msg = "CMD_MESSAGE_PASSWORD"
    elif command == CMD_MESSAGE_MP3:
        msg = "CMD_MESSAGE_MP3"
    elif command == CMD_MESSAGE_DELETE:
        msg = "CMD_MESSAGE_DELETE"
    elif command == CMD_MESSAGE_VERSION:
        msg = "CMD_MESSAGE_VERSION"
    elif command == CMD_MESSAGE_CDR_AVAILABLE:
        msg = "CMD_MESSAGE_CDR_AVAILABLE"
    elif command == CMD_MESSAGE_CDR:
        msg = "CMD_MESSAGE_CDR"
    else:
        msg = "CMD_MESSAGE_UNKNOWN"
    return msg
911214
def strip_command(self, command_string, output):
        """"""
        output_list = output.split(command_string)
        return self.RESPONSE_RETURN.join(output_list)
219714
def remove_perm(perm, user_or_group, forum=None):
    
    user, group = get_identity(user_or_group)
    perm = ForumPermission.objects.get(codename=perm)
    if user:
        UserForumPermission.objects.filter(
            forum=forum,
            permission=perm,
            user=user if not user.is_anonymous else None,
            anonymous_user=user.is_anonymous,
        ).delete()
    if group:
        GroupForumPermission.objects.filter(forum=forum, permission=perm, group=group).delete()
861310
def remove_command(parameter):
    
    conf = get_config_obj()

    section = "cli"
    if "." in parameter:
        section, parameter = parameter.split(".", 1)

    # ensure that the section exists
    if section not in conf:
        conf[section] = {}
    # remove the value for the given parameter
    del conf[section][parameter]

    # write to disk
    safeprint("Writing updated config to {}".format(conf.filename))
    conf.write()
217936
def _filter_data(self, pattern):
        '''
        
        '''
        removed = []
        filtered = []
        for param in self.data:
            if not param[0].startswith(pattern):
                filtered.append(param)
            else:
                removed.append(param)
        self.data = filtered
        return removed
462403
def exclude(self, pattern):
        """"""
        match = translate_pattern(pattern)
        return self._remove_files(match.match)
256054
def cmd_signing(self, args):
        ''''''
        usage = "signing: <setup|remove|disable|key> passphrase"
        if len(args) == 0:
            print(usage)
        elif args[0] == 'setup':
            self.cmd_signing_setup(args[1:])
        elif args[0] == 'key':
            self.cmd_signing_key(args[1:])
        elif args[0] == 'disable':
            self.cmd_signing_disable(args[1:])
        elif args[0] == 'remove':
            self.cmd_signing_remove(args[1:])
        else:
            print(usage)