<commit_before>
module ClusterChef
  module CookbookUtils

    #
    # Run state helpers
    #

    def run_state_includes?(hsh, state)
      Array(hsh[:run_state]).map(&:to_s).include?('start')
    end

    def startable?(hsh)
      run_state_includes?(hsh, :start)
    end

    #
    # Assert node state
    #
    def complain_if_not_sun_java(program)
      unless( node['java']['install_flavor'] == 'sun')
        warn "Warning!! You are *strongly* recommended to use Sun Java for #{program}. Set node['java']['install_flavor'] = 'sun' in a role -- right now it's '#{node['java']['install_flavor']}'"
      end
    end

    #
    # Best public or private IP
    #

    #
    # Change all occurences of a given line in-place in a file
    #
    # @param [String] name       - name for the resource invocation
    # @param [String] filename   - the file to modify (in-place)<commit_msg>Correcting hard-coded state in run_state_includes?<commit_after>
module ClusterChef
  module CookbookUtils

    #
    # Run state helpers
    #

    def run_state_includes?(hsh, state)
      Array(hsh[:run_state]).map(&:to_s).include?(state.to_str)
    end

    def startable?(hsh)
      run_state_includes?(hsh, :start)
    end

    #
    # Assert node state
    #
    def complain_if_not_sun_java(program)
      unless( node['java']['install_flavor'] == 'sun')
        warn "Warning!! You are *strongly* recommended to use Sun Java for #{program}. Set node['java']['install_flavor'] = 'sun' in a role -- right now it's '#{node['java']['install_flavor']}'"
      end
    end

    #
    # Best public or private IP
    #

    #
    # Change all occurences of a given line in-place in a file
    #
    # @param [String] name       - name for the resource invocation
    # @param [String] filename   - the file to modify (in-place)
{'fraction_non_alphanumeric': 0.12169603524229075, 'fraction_numerical': 0.0, 'mean_word_length': 2.7775467775467777, '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': '7554727', 'n_tokens_mistral': 592, 'n_tokens_neox': 577, 'n_words': 167}