<commit_before>module Unsplash # :nodoc: 

  # Unsplash Collection operations.
  class Collection < Client

    class << self

      # Get a specific collection.
      # @param id [Integer] The ID of the collection.
      # @return [Unsplash::Collection] The requested collection.
      def find(id, curated = false)
        url = ["/collections", (curated ? "curated" : nil), id].compact.join("/")
        Unsplash::Collection.new JSON.parse(connection.get(url).body)
      end

      # Get a list of all collections.
      # @param page [Integer] Which page of search results to return.
      # @param per_page [Integer] The number of search results per page.
      # @return [Array] A single page of the +Unsplash::Collection+ list.
      def all(page = 1, per_page = 10)
        params = {
          page:     page,
          per_page: per_page
        }
        list = JSON.parse(connection.get("/collections/", params).body)
        list.map { |data| Unsplash::Collection.new(data) }
      end

      # Get a list of all curated collections.
      # @param page [Integer] Which page of search results to return.
      # @param per_page [Integer] The number of search results per page.
      # @return [Array] A single page of the +Unsplash::Collection+ list.
      def curated(page = 1, per_page = 10)
        params = {
          page:     page,
          per_page: per_page
        }
        list = JSON.parse(connection.get("/collections/curated", params).body)
        list.map { |data| Unsplash::Collection.new(data) }
      end

      # Create a new collection on behalf of current user.
      # @param title [String] The title of the collection.
      # @param description [String] The collection's description. (optional)
      # @param private [Boolean] Whether to make the collection private. (optional, default +false+)
      def create(title:, description: "", private: false)
        params = { 
          title:       title,
          description: description,
          private:     private
        }
        Unsplash::Collection.new JSON.parse(connection.post("/collections", params).body)<commit_msg>Fix keyword arg for Ruby 2.0.<commit_after>module Unsplash # :nodoc: 

  # Unsplash Collection operations.
  class Collection < Client

    class << self

      # Get a specific collection.
      # @param id [Integer] The ID of the collection.
      # @return [Unsplash::Collection] The requested collection.
      def find(id, curated = false)
        url = ["/collections", (curated ? "curated" : nil), id].compact.join("/")
        Unsplash::Collection.new JSON.parse(connection.get(url).body)
      end

      # Get a list of all collections.
      # @param page [Integer] Which page of search results to return.
      # @param per_page [Integer] The number of search results per page.
      # @return [Array] A single page of the +Unsplash::Collection+ list.
      def all(page = 1, per_page = 10)
        params = {
          page:     page,
          per_page: per_page
        }
        list = JSON.parse(connection.get("/collections/", params).body)
        list.map { |data| Unsplash::Collection.new(data) }
      end

      # Get a list of all curated collections.
      # @param page [Integer] Which page of search results to return.
      # @param per_page [Integer] The number of search results per page.
      # @return [Array] A single page of the +Unsplash::Collection+ list.
      def curated(page = 1, per_page = 10)
        params = {
          page:     page,
          per_page: per_page
        }
        list = JSON.parse(connection.get("/collections/curated", params).body)
        list.map { |data| Unsplash::Collection.new(data) }
      end

      # Create a new collection on behalf of current user.
      # @param title [String] The title of the collection.
      # @param description [String] The collection's description. (optional)
      # @param private [Boolean] Whether to make the collection private. (optional, default +false+)
      def create(title: "", description: "", private: false)
        params = { 
          title:       title,
          description: description,
          private:     private
        }
        Unsplash::Collection.new JSON.parse(connection.post("/collections", params).body)
{'fraction_non_alphanumeric': 0.10691676436107854, 'fraction_numerical': 0.0032825322391559202, 'mean_word_length': 2.4046288906624103, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3365239', 'n_tokens_mistral': 1199, 'n_tokens_neox': 1162, 'n_words': 398}