<commit_before>module DPL
  class Provider
    class ChefSupermarket < Provider

      # Most of the code is inspired by:
      # https://github.com/opscode/chef/blob/11.16.4/lib/chef/knife/cookbook_site_share.rb

      # Compatibility with ruby 1.9
      requires 'chef', version: '< 12.0'
      requires 'chef', load: 'chef/config'
      requires 'chef', load: 'chef/cookbook_loader'
      requires 'chef', load: 'chef/cookbook_uploader'
      requires 'chef', load: 'chef/cookbook_site_streaming_uploader'

      attr_reader :cookbook_name, :cookbook_category
      attr_reader :cookbook

      def needs_key?
        false
      end

      def check_auth
        error "Missing user_id option" unless options[:user_id]
        error "Missing client_key option" unless options[:client_key]
        ::Chef::Config[:client_key] = options[:client_key]
        error "#{options[:client_key]} does not exist" unless ::File.exist?(options[:client_key])
      end

      def check_app
        @cookbook_name = options[:cookbook_name] || options[:app]<commit_msg>Pin mime-type & rack for chef_supermarket provider<commit_after>module DPL
  class Provider
    class ChefSupermarket < Provider

      # Most of the code is inspired by:
      # https://github.com/opscode/chef/blob/11.16.4/lib/chef/knife/cookbook_site_share.rb

      # Compatibility with ruby 1.9
      requires 'rack', version: '< 2.0'
      requires 'mime-types', version: '~> 1.16'
      requires 'chef', version: '< 12.0'
      requires 'chef', load: 'chef/config'
      requires 'chef', load: 'chef/cookbook_loader'
      requires 'chef', load: 'chef/cookbook_uploader'
      requires 'chef', load: 'chef/cookbook_site_streaming_uploader'

      attr_reader :cookbook_name, :cookbook_category
      attr_reader :cookbook

      def needs_key?
        false
      end

      def check_auth
        error "Missing user_id option" unless options[:user_id]
        error "Missing client_key option" unless options[:client_key]
        ::Chef::Config[:client_key] = options[:client_key]
        error "#{options[:client_key]} does not exist" unless ::File.exist?(options[:client_key])
      end

      def check_app
        @cookbook_name = options[:cookbook_name] || options[:app]
{'fraction_non_alphanumeric': 0.10977242302543508, 'fraction_numerical': 0.011155734047300312, 'mean_word_length': 3.128913443830571, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '804396', 'n_tokens_mistral': 731, 'n_tokens_neox': 697, 'n_words': 166}