Remove the read concern and/or write concern from the command if not applicable.

 @example
   session.suppress_read_write_concern!(cmd)

 @return [ Hash, BSON::Document ] The command document.

 @since 2.6.0
 @api private
967735
def suppress_read_write_concern!(command)
      command.tap do |c|
        next unless in_transaction?

        c.delete(:readConcern) unless starting_transaction?
        c.delete(:writeConcern) unless c[:commitTransaction] || c[:abortTransaction]
      end
    end
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)
619838
def check_command(self, name, exclude_packages=None, exclude_command_class=None):
    
    return get_command_class(
        name, 
        exclude_packages=exclude_packages,
        exclude_command_class=exclude_command_class) is not None
544921
def stop(&block)
      block.call('stop') unless block.nil?
      pid = read_pid
      fail 'No valid PID file.' unless pid && pid > 0
      Process.kill('TERM', pid)
      delete_pid
      puts 'Process terminated.'
    end
869754
def exec_ignore_code(command, options = {}, &block)
      options = (options || {}).merge(retrieve_exit_code: false, on_non_zero_exit_code: :ignore)
      exec command, options, &block
    end
85890
public void clearCommand(Command command) {
		List controls = getControlsFor(command);
		
		for (int i=0;i<controls.size();i++) {
	    	unbindCommand((Control) controls.get(i));
	    }
	}
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()
75277
def filter_commands(commands, invalid_query_starts=('DROP', 'UNLOCK', 'LOCK')):
    
    commands_with_drops = len(commands)
    filtered_commands = [c for c in commands if not c.startswith(invalid_query_starts)]
    if commands_with_drops - len(filtered_commands) > 0:
        print("\t" + str(invalid_query_starts) + " commands removed", commands_with_drops - len(filtered_commands))
    return filtered_commands
889949
def _op_msg(flags, command, dbname, read_preference, slave_ok, check_keys,
            opts, ctx=None):
    """"""
    command['$db'] = dbname
    if "$readPreference" not in command:
        if slave_ok and not read_preference.mode:
            command["$readPreference"] = (
                ReadPreference.PRIMARY_PREFERRED.document)
        else:
            command["$readPreference"] = read_preference.document
    name = next(iter(command))
    try:
        identifier = _FIELD_MAP.get(name)
        docs = command.pop(identifier)
    except KeyError:
        identifier = ""
        docs = None
    try:
        if ctx:
            return _op_msg_compressed(
                flags, command, identifier, docs, check_keys, opts, ctx)
        return _op_msg_uncompressed(
            flags, command, identifier, docs, check_keys, opts)
    finally:
        # Add the field back to the command.
        if identifier:
            command[identifier] = docs
567332
def purge(self, ignore_ignores):
        """"""
        command = ['sync', '#none']
        if ignore_ignores:
            command.append('--no-ignore')
        d = self._dovccmd(command, collectStdout=True)

        # add deferred to rm tree

        # then add defer to sync to revision
        return d
1304103
def get_all_commands_hash
      without_categories = {}
      category_command_map.each do |category, commands|
        without_categories.merge!(commands)
      end
      command_map.merge(without_categories)
    end
878682
function _resetReadLine(state) {
    if (state.rl) {
        state.rl.close();
    }

    state.rl = readline.createInterface({
        'input': state.input,
        'output': state.output,
        'completer': function(line, callback) {
            if (!_.isFunction(state.autocomplete)) {
                // No autocomplete was provided, do nothing
                return callback(null, [[], line]);
            }

            CommandAutocomplete.getAutocompleteArguments(state.currentCommand, line, function(abort, args) {
                if (abort) {
                    return callback(null, [[], line]);
                }

                state.autocomplete(args, function(err, replacements) {
                    if (err) {
                        return callback(err);
                    }

                    CommandAutocomplete.getAutocompleteReplacements(state.currentCommand, line, replacements, function(replacements, toReplace) {
                        // Convert the arguments into what node-readline expects
                        return callback(null, [replacements, toReplace]);
                    });
                });
            });
        }
    });

    /*!
     * Monkey-patch the setPrompt method to properly calculate the string length when colors are
     * used. :(
     *
     * http://stackoverflow.com/questions/12075396/adding-colors-to-terminal-prompt-results-in-large-white-space
     */
    var rl = state.rl;
    rl._setPrompt = rl.setPrompt;
    rl.setPrompt = function(prompt, length) {
        var strippedLength = null;
        if (length) {
            strippedLength = length;
        } else {
            var stripped = prompt.split(/[\r\n]/).pop().stripColors;
            if (stripped) {
                strippedLength = stripped.length;
            }
        }

        rl._setPrompt(prompt, strippedLength);
    };

    _bindSigint(state);
}
1347233
def _delete(
            self, sock_info, criteria, multi,
            write_concern=None, op_id=None, ordered=True,
            collation=None, session=None, retryable_write=False):
        """"""
        common.validate_is_mapping("filter", criteria)
        write_concern = write_concern or self.write_concern
        acknowledged = write_concern.acknowledged
        delete_doc = SON([('q', criteria),
                          ('limit', int(not multi))])
        collation = validate_collation_or_none(collation)
        if collation is not None:
            if sock_info.max_wire_version < 5:
                raise ConfigurationError(
                    'Must be connected to MongoDB 3.4+ to use collations.')
            elif not acknowledged:
                raise ConfigurationError(
                    'Collation is unsupported for unacknowledged writes.')
            else:
                delete_doc['collation'] = collation
        command = SON([('delete', self.name),
                       ('ordered', ordered),
                       ('deletes', [delete_doc])])
        if not write_concern.is_server_default:
            command['writeConcern'] = write_concern.document

        if not sock_info.op_msg_enabled and not acknowledged:
            # Legacy OP_DELETE.
            return self._legacy_write(
                sock_info, 'delete', command, op_id,
                False, message.delete, self.__full_name, criteria,
                False, write_concern.document,
                self.__write_response_codec_options,
                int(not multi))
        # Delete command.
        result = sock_info.command(
            self.__database.name,
            command,
            write_concern=write_concern,
            codec_options=self.__write_response_codec_options,
            session=session,
            client=self.__database.client,
            retryable_write=retryable_write)
        _check_write_command_response(result)
        return result
778174
def options
      exclude = %w[
        docs
        spec
        vendor
        core.rb
        .js
        templates
        commands
        internal
        support
        Dockerfile
        Dockerfile.base
        Gemfile
        Gemfile.lock
        Guardfile
        LICENSE
        Procfile
        Rakefile
        bin
      ]
      exclude = exclude.map { |word| ['-x', word] }.flatten
      ["-m", "README.md", "--markup", "tomdoc"] + exclude
    end
44429
private boolean removeUnreadable() {
		List<File> unreadable = inventory.removeUnreadable();
		unreadable.forEach(v->v.delete());
		return !unreadable.isEmpty();
	}
776542
def write_and_logging(message, command, secret = false)
      logging_message = secret ? message : message + command
      @logger.info logging_message
      if @writer.closed?
        @logger.error "Try to write #{command}, but writer closed"
        @commands.clear
      else
        @writer.puts command
      end
    end
1147351
def purge
      output.each do |file, format|
        if File.exist?(file)
          rm(file)
          report "Removed #{file}"
        end
      end
    end