<commit_before>
module SecureDataBag
end

require "secure_data_bag/version"
require "secure_data_bag/secure_data_bag_item.rb"
require "secure_data_bag/decryptor.rb"
require "secure_data_bag/encryptor.rb"

class Chef
  module DSL
    module DataQuery
      def secure_data_bag_item(bag, item)
        DataBag.validate_name!(bag.to_s)
        SecureDataBagItem.validate_id!(item)
        SecureDataBagItem.load(bag, item)
      rescue Exception
        Log.error("Failed to load secure data bag item: #{bag.inspect} #{item.inspect}")
        raise
      end

      def secure_data_bag_item!(item, fields=[])
        secure = SecureDataBag::SecureDataBagItem.from_item item
        secure.encode_fields secure.encode_fields + fields
        secure
      end
    end
  end
end
<commit_msg>Mawr coffee<commit_after>
module SecureDataBag
end

require "secure_data_bag/version"
require "secure_data_bag/secure_data_bag_item.rb"
require "secure_data_bag/decryptor.rb"
require "secure_data_bag/encryptor.rb"

class Chef
  module DSL
    module DataQuery
      def secure_data_bag_item(bag, item)
        DataBag.validate_name!(bag.to_s)
        SecureDataBagItem.validate_id!(item)
        SecureDataBagItem.load(bag, item)
      rescue Exception
        Log.error("Failed to load secure data bag item: #{bag.inspect} #{item.inspect}")
        raise
      end

      def secure_data_bag_item!(item, fields=[])
        secure = SecureDataBag::SecureDataBagItem.from_item item
        secure.encoded_fields secure.encoded_fields + fields
        secure
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.07898089171974522, 'fraction_numerical': 0.0, 'mean_word_length': 3.339779005524862, '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': '5794316', 'n_tokens_mistral': 506, 'n_tokens_neox': 499, 'n_words': 105}