<commit_before>module Vault
  module Config
    @@defaults = {}

    # An environment variable from another app.
    #
    # @param app [String] The name of the app to get the value from.
    # @param name [String] The name of the environment variable to fetch a
    #   value for.
    # @return [String] The value of an environment variable from another
    #   Heroku app or nil if no match is available.
    def self.remote_env(app, name)
      heroku = Heroku::API.new
      heroku.get_config_vars(app).body[name]
    end

    # An environment variable.
    #
    # @param name [String] The name of the environment variable to fetch a
    #   value for.
    # @return [String] The value of the environment variable or nil if no
    #   match is available.
    def self.env(name)
      self[name]
    end

    def self.default(key, value)
      @@defaults[key] = value
    end

    def self.defaults
      @@defaults
    end

    def self.[](name)
      var_name = name.to_s.upcase
      ENV[var_name] || @@defaults[name]
    end

    # An environment variable.
    #
    # @param name [String] The name of the environment variable to fetch a
    #   value for.
    # @raise [RuntimeError] Raised if the environment variable is not defined.
    # @return [String] The value of the environment variable.
    def self.env!(name)
      self[name] || raise("missing #{name}")
    end

    # The `RACK_ENV` environment variable is used to determine whether the<commit_msg>docstrings<commit_after>module Vault
  module Config
    @@defaults = {}

    # An environment variable from another app.
    #
    # @param app [String] The name of the app to get the value from.
    # @param name [String] The name of the environment variable to fetch a
    #   value for.
    # @return [String] The value of an environment variable from another
    #   Heroku app or nil if no match is available.
    def self.remote_env(app, name)
      heroku = Heroku::API.new
      heroku.get_config_vars(app).body[name]
    end

    # An environment variable.
    #
    # @param name [String] The name of the environment variable to fetch a
    #   value for.
    # @return [String] The value of the environment variable or nil if no
    #   match is available.
    def self.env(name)
      self[name]
    end

    # Set a default
    # Defaults are supplied when accessing via Config[:varname]
    #
    # @param key [Symbol/String] The lower-case name of the default
    # @return [String] The value of the default
    def self.default(key, value)
      @@defaults[key.to_sym] = value
    end

    # Get all the defaults
    # @return [Hash] The current set of defaults
    def self.defaults
      @@defaults
    end

    # Get a Config value
    # Uses defaults if available.  Converts upper-case ENV var names
    # to lower-case default names.
    #
    # Config[:foo] == nil
    #
    # Config.default(:foo, 'bar')
    # Config[:foo] == 'bar'
    #
    # ENV['FOO'] = 'baz'
    # Config[:foo] == 'baz'
    #
    # @param key [Symbol] The lower-case name of the ENV value
    # @return [String] The value of the ENV value or default.
    def self.[](name)
      var_name = name.to_s.upcase
      ENV[var_name] || @@defaults[name]
    end

    # An environment variable.
    #
    # @param name [String] The name of the environment variable to fetch a
    #   value for.
    # @raise [RuntimeError] Raised if the environment variable is not defined.
    # @return [String] The value of the environment variable.
    def self.env!(name)
      self[name] || raise("missing #{name}")
    end

    # The `RACK_ENV` environment variable is used to determine whether the
{'fraction_non_alphanumeric': 0.09190672153635117, 'fraction_numerical': 0.0, 'mean_word_length': 2.522705314009662, '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': '4791212', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1064, 'n_words': 419}