<commit_before>module Lolita
  module Authorization
    def public_user?
      !current_user.is_a? Admin::SystemUser if logged_in?
    end

    def system_user?
      !public_user? if logged_in?
    end
  end
  
  class Config
    # Lolita's configuration tool
    # all configuration is in YAML file located config/lolita.yml
    # Lolita's config you can access via Lolita.config or $lolita_config
    # Example:
    #   ----YAML----
    #     production:
    #       foo:
    #         baz:
    #           one: 1
    #           two: 2
    #       gmail:
    #         key: <KEY>
    #   ----CODE----
    #   Lolita.config.foo :baz, :one
    #   > 1
    #   Lolita.config.foo
    #   > {'baz' => {'one' => 1, 'two' => 2}}
    #

    attr_accessor :conf

    def initialize
      self.conf = YAML::parse_file("#{RAILS_ROOT}/config/lolita.yml").select("/#{RAILS_ENV}")[0].transform
    end

    def method_missing(key,*args)
      eval "self.conf['#{key}']#{args ? args.collect{|a| "['#{a}']"}.join : ""}"
    end

    def update *args
      return false unless args.size > 1
      eval "self.conf#{args[0,args.size-1].collect{|a| "['#{a}']"}.join} = args[args.size-1]"
      true
    end

  end

  def config
    $lolita_config
  end
  module_function :config
end<commit_msg>If Lolita.config returns Hash we symbolize it keys<commit_after>module Lolita
  module Authorization
    def public_user?
      !current_user.is_a? Admin::SystemUser if logged_in?
    end

    def system_user?
      !public_user? if logged_in?
    end
  end
  
  class Config
    # Lolita's configuration tool
    # all configuration is in YAML file located config/lolita.yml
    # Lolita's config you can access via Lolita.config or $lolita_config
    # Example:
    #   ----YAML----
    #     production:
    #       foo:
    #         baz:
    #           one: 1
    #           two: 2
    #       gmail:
    #         key: <KEY>
    #   ----CODE----
    #   Lolita.config.foo :baz, :one
    #   > 1
    #   Lolita.config.foo
    #   > {'baz' => {'one' => 1, 'two' => 2}}
    #

    attr_accessor :conf

    def initialize
      self.conf = YAML::parse_file("#{RAILS_ROOT}/config/lolita.yml").select("/#{RAILS_ENV}")[0].transform
    end

    def method_missing(key,*args)
      value = eval "self.conf['#{key}']#{args ? args.collect{|a| "['#{a}']"}.join : ""}"
      value.is_a?(Hash) ? value.symbolize_keys! : value
    end

    def update *args
      return false unless args.size > 1
      eval "self.conf#{args[0,args.size-1].collect{|a| "['#{a}']"}.join} = args[args.size-1]"
      true
    end

  end

  def config
    $lolita_config
  end
  module_function :config
end
{'fraction_non_alphanumeric': 0.14602935641701167, 'fraction_numerical': 0.007527286413248024, 'mean_word_length': 2.0835266821345706, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '599373', 'n_tokens_mistral': 968, 'n_tokens_neox': 939, 'n_words': 208}