<commit_before>module MCollective
    module RPC 
        # The main component of the Simple RPC client system, this wraps around MCollective::Client
        # and just brings in a lot of convention and standard approached.
        class Client
            attr_accessor :discovery_timeout, :timeout, :verbose, :filter, :config, :progress
            attr_reader :client, :stats

            # Creates a stub for a remote agent, you can pass in an options array in the flags
            # which will then be used else it will just create a default options array with
            # filtering enabled based on the standard command line use.
            #
            #   rpc = RPC::Client.new("rpctest", :configfile => "client.cfg", :options => options)
            #
            # You typically would not call this directly you'd use MCollective::RPC#rpcclient instead
            # which is a wrapper around this that can be used as a Mixin
            def initialize(agent, flags = {})
                if flags.include?(:options)
                    options = flags[:options]
                else
                    oparser = MCollective::Optionparser.new({:verbose => false}, "filter")
                    
                    options = oparser.parse do |parser, options|
                        if block_given?
                            yield(parser, options) 
                        end 
                    end
                end

                @stats = Stats.new
                @agent = agent
                @discovery_timeout = options[:disctimeout]
                @timeout = options[:timeout]
                @verbose = options[:verbose]
                @filter = options[:filter]
                @filter["agent"] << agent
                @config = options[:config]
                @discovered_agents = nil
                @progress = options[:progress_bar]

                @client = client = MCollective::Client.new(@config)
                @client.options = options

                STDERR.sync = true
                STDOUT.sync = true
            end

            # Creates a suitable request hash for the SimpleRPC agent.
            #
            # You'd use this if you ever wanted to take care of sending 
            # requests on your own - perhaps via Client#sendreq if you
            # didn't care for responses.<commit_msg>Set progress bar to true by default<commit_after>module MCollective
    module RPC 
        # The main component of the Simple RPC client system, this wraps around MCollective::Client
        # and just brings in a lot of convention and standard approached.
        class Client
            attr_accessor :discovery_timeout, :timeout, :verbose, :filter, :config, :progress
            attr_reader :client, :stats

            # Creates a stub for a remote agent, you can pass in an options array in the flags
            # which will then be used else it will just create a default options array with
            # filtering enabled based on the standard command line use.
            #
            #   rpc = RPC::Client.new("rpctest", :configfile => "client.cfg", :options => options)
            #
            # You typically would not call this directly you'd use MCollective::RPC#rpcclient instead
            # which is a wrapper around this that can be used as a Mixin
            def initialize(agent, flags = {})
                if flags.include?(:options)
                    options = flags[:options]
                else
                    oparser = MCollective::Optionparser.new({:verbose => false}, "filter")
                    
                    options = oparser.parse do |parser, options|
                        if block_given?
                            yield(parser, options) 
                        end 
                    end
                end

                @stats = Stats.new
                @agent = agent
                @discovery_timeout = options[:disctimeout]
                @timeout = options[:timeout]
                @verbose = options[:verbose]
                @filter = options[:filter]
                @filter["agent"] << agent
                @config = options[:config]
                @discovered_agents = nil
                @progress = options[:progress_bar] || true

                @client = client = MCollective::Client.new(@config)
                @client.options = options

                STDERR.sync = true
                STDOUT.sync = true
            end

            # Creates a suitable request hash for the SimpleRPC agent.
            #
            # You'd use this if you ever wanted to take care of sending 
            # requests on your own - perhaps via Client#sendreq if you
            # didn't care for responses.
{'fraction_non_alphanumeric': 0.07001265288907633, 'fraction_numerical': 0.0, 'mean_word_length': 1.4976303317535544, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '790907', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1029, 'n_words': 404}