<commit_before>module Vagrant
  module Util
    class Experimental
      VALID_FEATURES = []
      class << self

        # A method for determining if the experimental flag has been enabled
        #
        # @return [Boolean]
        def global_enabled?
          if !defined?(@_experimental)
            experimental = ENV["VAGRANT_EXPERIMENTAL"].to_s
            if experimental != "0" && !experimental.empty?
              @_experimental = true
            else
              @_experimental = false
            end
          end
          @_experimental
        end

        # A method for Vagrant internals to determine if a given feature
        # has been abled and can be used.
        #
        # @param [String] feature
        # @return [Boolean] - A hash containing the original array and if it is valid
        def feature_enabled?(feature)
          experimental = features_requested
          feature = feature.to_s

          if experimental.size == 1 && experimental.first == "1"
            return true
          elsif VALID_FEATURES.include?(feature) &&
                experimental.include?(feature)
            return true
          else<commit_msg>Move feature flag checking into a single function<commit_after>module Vagrant
  module Util
    class Experimental
      VALID_FEATURES = []
      class << self

        # A method for determining if the experimental flag has been enabled
        #
        # @return [Boolean]
        def global_enabled?
          if !defined?(@_experimental)
            experimental = features_requested
            if experimental.size >= 1 && experimental.first != "0"
              @_experimental = true
            else
              @_experimental = false
            end
          end
          @_experimental
        end

        # A method for Vagrant internals to determine if a given feature
        # has been abled and can be used.
        #
        # @param [String] feature
        # @return [Boolean] - A hash containing the original array and if it is valid
        def feature_enabled?(feature)
          experimental = features_requested
          feature = feature.to_s

          if experimental.size == 1 && experimental.first == "1"
            return true
          elsif VALID_FEATURES.include?(feature) &&
                experimental.include?(feature)
            return true
          else
{'fraction_non_alphanumeric': 0.06486941870261162, 'fraction_numerical': 0.0029486099410278013, 'mean_word_length': 1.7298850574712643, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, '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': '6517994', 'n_tokens_mistral': 577, 'n_tokens_neox': 562, 'n_words': 195}