<commit_before>require 'cfpropertylist'
require 'open3'

begin
  require 'libxml'
rescue LoadError
  'Appease rubocop'
end

module Xcodeproj
  # Provides support for loading and serializing property list files.
  #
  module PlistHelper
    class << self
      # Serializes a hash as an XML property list file.
      #
      # @param  [#to_hash] hash
      #         The hash to store.
      #
      # @param  [#to_s] path
      #         The path of the file.
      #
      def write(hash, path)
        unless hash.is_a?(Hash)
          if hash.respond_to?(:to_hash)
            hash = hash.to_hash
          else
            raise TypeError, "The given `#{hash}`, must be a hash or " \
              "respond to to_hash"
          end
        end

        unless path.is_a?(String) || path.is_a?(Pathname)
            raise TypeError, "The given `#{path}`, must be a string or " \
              "pathname"
        end<commit_msg>[PlistHelper] Remove rescue statement which served only informative purposes<commit_after>require 'cfpropertylist'
require 'open3'

module Xcodeproj
  # Provides support for loading and serializing property list files.
  #
  # @note CFPropertyList will automatically pick up the `libxml` strategy or
  #       other faster strategies, if their dependencies are available.
  #
  module PlistHelper
    class << self
      # Serializes a hash as an XML property list file.
      #
      # @param  [#to_hash] hash
      #         The hash to store.
      #
      # @param  [#to_s] path
      #         The path of the file.
      #
      def write(hash, path)
        unless hash.is_a?(Hash)
          if hash.respond_to?(:to_hash)
            hash = hash.to_hash
          else
            raise TypeError, "The given `#{hash}`, must be a hash or " \
              "respond to to_hash"
          end
        end

        unless path.is_a?(String) || path.is_a?(Pathname)
            raise TypeError, "The given `#{path}`, must be a string or " \
              "pathname"
        end
{'fraction_non_alphanumeric': 0.08552958727001492, 'fraction_numerical': 0.000994530084535057, 'mean_word_length': 1.8908045977011494, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1438096', 'n_tokens_mistral': 592, 'n_tokens_neox': 599, 'n_words': 199}