<commit_before># encoding: utf-8

module Github
  # Specifies Http connection options
  module Connection
    extend self
    include Github::Constants

    ALLOWED_OPTIONS = [
      :headers,
      :url,
      :params,
      :request,
      :ssl
    ].freeze

    # Default requets header information
    #
    # @return [Hash[String]]
    #
    # @api private
    def default_headers
      {
        ACCEPT         => 'application/vnd.github.v3+json,' \
                          'application/vnd.github.beta+json;q=0.5,' \
                          'application/json;q=0.1',
        ACCEPT_CHARSET => 'utf-8'
      }
    end

    # Create default connection options
    #
    # @return [Hash[Symbol]]
    #   the default options
    #
    # @api private
    def default_options(options = {})
      headers = default_headers.merge(options[:headers] || {})
      headers.merge!({USER_AGENT => options[:user_agent]})
      {
        headers: headers,
        ssl: options[:ssl],
        url: options[:endpoint]
      }
    end

    # Exposes middleware builder to facilitate custom stacks and easy
    # addition of new extensions such as cache adapter.
    #
    # @api public
    def stack(options = {})
      @stack ||= begin
        builder_class = if defined?(Faraday::RackBuilder)
                          Faraday::RackBuilder
                        else
                          Faraday::Builder<commit_msg>add custom media type to allow branch protection api<commit_after># encoding: utf-8

module Github
  # Specifies Http connection options
  module Connection
    extend self
    include Github::Constants

    ALLOWED_OPTIONS = [
      :headers,
      :url,
      :params,
      :request,
      :ssl
    ].freeze

    # Default requets header information
    #
    # @return [Hash[String]]
    #
    # @api private
    def default_headers
      {
        ACCEPT         => 'application/vnd.github.v3+json,' \
                          'application/vnd.github.beta+json;q=0.5,' \
                          'application/vnd.github.loki-preview+json,' \
                          'application/json;q=0.1',
        ACCEPT_CHARSET => 'utf-8'
      }
    end

    # Create default connection options
    #
    # @return [Hash[Symbol]]
    #   the default options
    #
    # @api private
    def default_options(options = {})
      headers = default_headers.merge(options[:headers] || {})
      headers.merge!({USER_AGENT => options[:user_agent]})
      {
        headers: headers,
        ssl: options[:ssl],
        url: options[:endpoint]
      }
    end

    # Exposes middleware builder to facilitate custom stacks and easy
    # addition of new extensions such as cache adapter.
    #
    # @api public
    def stack(options = {})
      @stack ||= begin
        builder_class = if defined?(Faraday::RackBuilder)
                          Faraday::RackBuilder
                        else
                          Faraday::Builder
{'fraction_non_alphanumeric': 0.10152801358234295, 'fraction_numerical': 0.004753820033955857, 'mean_word_length': 1.7897727272727273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2824487', 'n_tokens_mistral': 834, 'n_tokens_neox': 814, 'n_words': 192}