<commit_before>require 'heroku/helpers'
require 'heroku/plugin'
require 'heroku/builtin_plugin'
#require 'heroku/commands/base'
require 'vendor/okjson'

#Dir["#{File.dirname(__FILE__)}/commands/*.rb"].each { |c| require c }

module Heroku
  module Command
    class InvalidCommand < RuntimeError; end
    class CommandFailed  < RuntimeError; end

    extend Heroku::Helpers

    def self.load
      Dir[File.join(File.dirname(__FILE__), "command", "*.rb")].each do |file|
        require file
      end
    end

    def self.commands
      @@commands ||= {}
    end

    def self.namespaces
      @@namespaces ||= {}
    end

    def self.register_command(command)
      namespace = command[:klass].namespace
      name = command[:method].to_s == "index" ? nil : command[:method]
      commands[command[:command]] = command
    end

    def self.register_namespace(namespace)
      namespaces[namespace[:name]] = namespace
    end

    def self.optparse_class(value)
      case value
        when FalseClass then TrueClass
        else value.class
      end
   end

    def self.current_command<commit_msg>clean up optparse<commit_after>require 'heroku/helpers'
require 'heroku/plugin'
require 'heroku/builtin_plugin'
require "optparse"
require 'vendor/okjson'

#Dir["#{File.dirname(__FILE__)}/commands/*.rb"].each { |c| require c }

module Heroku
  module Command
    class InvalidCommand < RuntimeError; end
    class CommandFailed  < RuntimeError; end

    extend Heroku::Helpers

    def self.load
      Dir[File.join(File.dirname(__FILE__), "command", "*.rb")].each do |file|
        require file
      end
    end

    def self.commands
      @@commands ||= {}
    end

    def self.namespaces
      @@namespaces ||= {}
    end

    def self.register_command(command)
      namespace = command[:klass].namespace
      name = command[:method].to_s == "index" ? nil : command[:method]
      commands[command[:command]] = command
    end

    def self.register_namespace(namespace)
      namespaces[namespace[:name]] = namespace
    end

    def self.current_command
{'fraction_non_alphanumeric': 0.11648139197680038, 'fraction_numerical': 0.0, 'mean_word_length': 3.099009900990099, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1318517', 'n_tokens_mistral': 618, 'n_tokens_neox': 608, 'n_words': 145}