<commit_before>require 'parseconfig'

module Stripe
  module CLI
    class Command < Thor
      @@root_config = ::File.expand_path('~/.stripecli')
      @@local_config = ::File.expand_path('./.stripecli')

      class_option :key, :aliases => :k, :desc => "One of your API secret keys, provided by Stripe"
      class_option :env, :aliases => :e, :desc => "This param expects a ~/.stripecli file with section headers for any string passed into it"
      class_option :version, :aliases => :v, :desc => "Stripe API version-date. Looks like `YYYY-MM-DD`"
      class_option :dollar_amounts, :type => :boolean, :default => true, :desc => "set expected currency units to dollars or cents"

      protected

      def api_key
        @api_key ||= options[:key] || stored_api_option('key')
      end

      def api_version
        @api_version ||= options.delete(:version) || stored_api_option('version')
      end

      def environment
        @env ||= options.delete(:env) || config['default']
      end

      def dollar_amounts
        stored_api_option('dollar_amounts') == 'false' ?
        false : options.delete(:dollar_amounts)
      end

      def stored_api_option option
        if File.exists?(config_file)
          if environment
            config[environment][option.to_s] || config[option.to_s]
          else
            config[option.to_s]
          end
        end
      end

      def config
        ParseConfig.new(config_file) if File.exist?(config_file)
      end

      def config_file
        File.exist?(@@local_config) ? @@local_config : @@root_config
      end
<commit_msg>Quick fix of regression with dollar amounts<commit_after>require 'parseconfig'

module Stripe
  module CLI
    class Command < Thor
      @@root_config = ::File.expand_path('~/.stripecli')
      @@local_config = ::File.expand_path('./.stripecli')

      class_option :key, :aliases => :k, :desc => "One of your API secret keys, provided by Stripe"
      class_option :env, :aliases => :e, :desc => "This param expects a ~/.stripecli file with section headers for any string passed into it"
      class_option :version, :aliases => :v, :desc => "Stripe API version-date. Looks like `YYYY-MM-DD`"
      class_option :dollar_amounts, :type => :boolean, :desc => "set expected currency units to dollars or cents"

      protected

      def api_key
        @api_key ||= options[:key] || stored_api_option('key')
      end

      def api_version
        @api_version ||= options.delete(:version) || stored_api_option('version')
      end

      def environment
        @env ||= options.delete(:env) || config['default']
      end

      def dollar_amounts
        param_option = options.delete(:dollar_amounts)
        param_option.nil? ? stored_api_option('dollar_amounts') == 'false' ? false : true : param_option
      end

      def stored_api_option option
        if File.exists?(config_file)
          if environment
            config[environment][option.to_s] || config[option.to_s]
          else
            config[option.to_s]
          end
        end
      end

      def config
        ParseConfig.new(config_file) if File.exist?(config_file)
      end

      def config_file
        File.exist?(@@local_config) ? @@local_config : @@root_config
      end

{'fraction_non_alphanumeric': 0.11369904995403003, 'fraction_numerical': 0.0, 'mean_word_length': 2.6591928251121075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '1276599', 'n_tokens_mistral': 989, 'n_tokens_neox': 954, 'n_words': 258}