<commit_before>module CgminerApiClient
  class Miner
    module Commands
      module ReadOnly
        def asc(number)
          query(:asc, number)
        end

        def asccount
          query(:asccount)
        end

        def check(command)
          query(:check, command)[0]
        end

        def coin
          query(:coin)[0]
        end

        def config
          query(:config)[0]
        end

        def devdetails
          query(:devdetails)
        end

        def devs
          query(:devs)
        end

        def pga(number)
          query(:pga, number)
        end

        def pgacount
          query(:pgacount)
        end

        def pools
          query(:pools)
        end

        def privileged?
          check_privileged = check('privileged')
          check_privileged[:exists] == 'Y' && check_privileged[:access] == 'Y'
        end

        def notify
          query(:notify)
        end

        def stats
          query(:stats)
        end

        def summary
          query(:summary)[0]
        end

        def usbstats
          query(:usbstats)
        end

        def version
          query(:version)[0]
        end
      end

      module Privileged
        module General
          def quit
            query(:quit) unless access_denied?
          end

          def restart
            query(:restart) unless access_denied?
          end
        end

        module Pool
          def addpool(url, user, pass)
            query(:addpool, url, user, pass) unless access_denied?
          end

          def disablepool(number)
            query(:disablepool, number) unless access_denied?
          end

          def enablepool(number)
            query(:enablepool, number) unless access_denied?
          end

          def poolpriority(*id_order)
            query(:poolpriority, *id_order) unless access_denied?
          end

          def poolquota(number, value)
            query(:poolquota, number, value) unless access_denied?
          end

          def removepool(number)
            query(:removepool, number) unless access_denied?
          end

          def switchpool
            query(:switchpool, number) unless access_denied?
          end
        end

        private

        def access_denied?
          if !privileged?
            raise 'access denied'
          else
            return false
          end
        end

        include Miner::Commands::Privileged::General
        include Miner::Commands::Privileged::Pool
      end

      include Miner::Commands::ReadOnly
      include Miner::Commands::Privileged
    end
  end
end<commit_msg>underscore<commit_after>module CgminerApiClient
  class Miner
    module Commands
      module ReadOnly
        def asc(number)
          query(:asc, number)
        end

        def asccount
          query(:asccount)
        end

        def check(command)
          query(:check, command)[0]
        end

        def coin
          query(:coin)[0]
        end

        def config
          query(:config)[0]
        end

        def devdetails
          query(:devdetails)
        end

        def devs
          query(:devs)
        end

        def pga(number)
          query(:pga, number)
        end

        def pgacount
          query(:pgacount)
        end

        def pools
          query(:pools)
        end

        def privileged?
          check_privileged = check('privileged')
          check_privileged[:exists] == 'Y' && check_privileged[:access] == 'Y'
        end

        def notify
          query(:notify)
        end

        def stats
          query(:stats)
        end

        def summary
          query(:summary)[0]
        end

        def usbstats
          query(:usbstats)
        end

        def version
          query(:version)[0]
        end
      end

      module Privileged
        module General
          def quit
            query(:quit) unless access_denied?
          end

          def restart
            query(:restart) unless access_denied?
          end
        end

        module Pool
          def addpool(url, user, pass)
            query(:addpool, url, user, pass) unless access_denied?
          end

          def disablepool(number)
            query(:disablepool, number) unless access_denied?
          end

          def enablepool(number)
            query(:enablepool, number) unless access_denied?
          end

          def poolpriority(*id_order)
            query(:poolpriority, *id_order) unless access_denied?
          end

          def poolquota(number, value)
            query(:poolquota, number, value) unless access_denied?
          end

          def removepool(number)
            query(:removepool, number) unless access_denied?
          end

          def switchpool
            query(:switchpool, number) unless access_denied?
          end
        end

        private

        def access_denied?
          if !privileged?
            raise 'access_denied'
          else
            return false
          end
        end

        include Miner::Commands::Privileged::General
        include Miner::Commands::Privileged::Pool
      end

      include Miner::Commands::ReadOnly
      include Miner::Commands::Privileged
    end
  end
end
{'fraction_non_alphanumeric': 0.06723646723646724, 'fraction_numerical': 0.001899335232668566, 'mean_word_length': 1.3936363636363636, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1445595', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1357, 'n_words': 360}