<commit_before>require "date"

module Rapa
  module Resources
    class ItemResource < BaseResource
      # @return [Boolean, nil]
      def adult_product?
        if flag_source = source.dig("ItemAttributes", "IsAdultProduct")
          flag_source != "0"
        end
      end

      # @return [Array<Rapa::AlternateVersion>, nil]
      def alternate_versions
        if alternate_version_sources = source.dig("AlternateVersions", "AlternateVersion")
          ::Array.wrap(alternate_version_sources).map do |alternate_version_source|
            ::Rapa::AlternateVersion.new(alternate_version_source)
          end
        end
      end

      # @return [String]
      def asin
        source["ASIN"]
      end

      # @return [Array<String>, nil]
      def authors
        if author_sources = source.dig("ItemAttributes", "Author")
          Array(author_sources)
        end
      end

      # @return [String, nil]
      def binding
        source.dig("ItemAttributes", "Binding")
      end

      # @return [Array, nil]
      def browse_nodes
        source.dig("BrowseNodes", "BrowseNode").map do |browse_node_source|
          ::Rapa::BrowseNode.new(browse_node_source)
        end
      end

      # @return [String, nil]
      def creator_name
        source.dig("ItemAttributes", "Creator", "__content__")<commit_msg>Fix comment<commit_after>require "date"

module Rapa
  module Resources
    class ItemResource < BaseResource
      # @return [Boolean, nil]
      def adult_product?
        if flag_source = source.dig("ItemAttributes", "IsAdultProduct")
          flag_source != "0"
        end
      end

      # @return [Array<Rapa::AlternateVersion>, nil]
      def alternate_versions
        if alternate_version_sources = source.dig("AlternateVersions", "AlternateVersion")
          ::Array.wrap(alternate_version_sources).map do |alternate_version_source|
            ::Rapa::AlternateVersion.new(alternate_version_source)
          end
        end
      end

      # @return [String]
      def asin
        source["ASIN"]
      end

      # @return [Array<String>, nil]
      def authors
        if author_sources = source.dig("ItemAttributes", "Author")
          Array(author_sources)
        end
      end

      # @return [String, nil]
      def binding
        source.dig("ItemAttributes", "Binding")
      end

      # @return [Array]
      def browse_nodes
        source.dig("BrowseNodes", "BrowseNode").map do |browse_node_source|
          ::Rapa::BrowseNode.new(browse_node_source)
        end
      end

      # @return [String, nil]
      def creator_name
        source.dig("ItemAttributes", "Creator", "__content__")
{'fraction_non_alphanumeric': 0.10214851111948738, 'fraction_numerical': 0.0007538635506973238, 'mean_word_length': 2.406931964056483, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '1062767', 'n_tokens_mistral': 786, 'n_tokens_neox': 761, 'n_words': 167}