<commit_before>require 'ostruct'
module I18n::Tasks
  class CommandsBase
    def locales_opt(locales)
      return i18n_task.locales if locales == ['all'] || locales == 'all'
      if locales.present?
        locales = Array(locales).map { |v| v.strip.split(/\s*[\+,:]\s*/).compact.presence if v.is_a?(String) }.flatten
        locales = locales.map { |v| v == 'base' ? base_locale : v }
        locales
      else
        i18n_task.locales
      end
    end

    class << self
      def cmds
        @cmds ||= {}.with_indifferent_access
      end

      def cmd(name, &block)
        cmds[name] = OpenStruct.new(@next_def)
        @next_def  = {}
        define_method(name, &block)
      end

      def desc(text)
        next_def[:desc] = text<commit_msg>skip nil arg<commit_after>require 'ostruct'
module I18n::Tasks
  class CommandsBase
    def locales_opt(locales)
      return i18n_task.locales if locales == ['all'] || locales == 'all'
      if locales.present?
        locales = Array(locales).map { |v| v.strip.split(/\s*[\+,:]\s*/).compact.presence if v.is_a?(String) }.flatten
        locales = locales.map(&:presence).compact.map { |v| v == 'base' ? base_locale : v }
        locales
      else
        i18n_task.locales
      end
    end

    class << self
      def cmds
        @cmds ||= {}.with_indifferent_access
      end

      def cmd(name, &block)
        cmds[name] = OpenStruct.new(@next_def)
        @next_def  = {}
        define_method(name, &block)
      end

      def desc(text)
        next_def[:desc] = text
{'fraction_non_alphanumeric': 0.1364522417153996, 'fraction_numerical': 0.007797270955165692, 'mean_word_length': 2.255813953488372, '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': '6516552', 'n_tokens_mistral': 550, 'n_tokens_neox': 534, 'n_words': 113}