<commit_before>
require 'rest-core'

# https://www.firebase.com/docs/security/custom-login.html
# https://www.firebase.com/docs/rest-api.html
# https://www.firebase.com/docs/rest/guide/retrieving-data.html#section-rest-queries
RestFirebase = RC::Builder.client(:d, :secret, :auth, :auth_ttl, :iat) do
  use RC::DefaultSite   , 'https://SampleChat.firebaseIO-demo.com/'
  use RC::DefaultHeaders, {'Accept' => 'application/json',
                           'Content-Type' => 'application/json'}
  use RC::DefaultQuery  , nil
  use RC::JsonRequest   , true

  use RC::Retry         , 0, RC::Retry::DefaultRetryExceptions
  use RC::Timeout       , 10
  use RC::FollowRedirect, 10
  use RC::ErrorHandler  , lambda{ |env| RestFirebase::Error.call(env) }
  use RC::ErrorDetectorHttp
  use RC::JsonResponse  , true
  use RC::CommonLogger  , nil
  use RC::Cache         , nil, 600
end

class RestFirebase::Error < RestCore::Error
  include RestCore
  class ServerError         < RestFirebase::Error; end
  class ClientError         < RestCore::Error; end

  class BadRequest          < RestFirebase::Error; end<commit_msg>only follow 5 times at max<commit_after>
require 'rest-core'

# https://www.firebase.com/docs/security/custom-login.html
# https://www.firebase.com/docs/rest-api.html
# https://www.firebase.com/docs/rest/guide/retrieving-data.html#section-rest-queries
RestFirebase = RC::Builder.client(:d, :secret, :auth, :auth_ttl, :iat) do
  use RC::DefaultSite   , 'https://SampleChat.firebaseIO-demo.com/'
  use RC::DefaultHeaders, {'Accept' => 'application/json',
                           'Content-Type' => 'application/json'}
  use RC::DefaultQuery  , nil
  use RC::JsonRequest   , true

  use RC::Retry         , 0, RC::Retry::DefaultRetryExceptions
  use RC::Timeout       , 10
  use RC::FollowRedirect, 5
  use RC::ErrorHandler  , lambda{ |env| RestFirebase::Error.call(env) }
  use RC::ErrorDetectorHttp
  use RC::JsonResponse  , true
  use RC::CommonLogger  , nil
  use RC::Cache         , nil, 600
end

class RestFirebase::Error < RestCore::Error
  include RestCore
  class ServerError         < RestFirebase::Error; end
  class ClientError         < RestCore::Error; end

  class BadRequest          < RestFirebase::Error; end
{'fraction_non_alphanumeric': 0.13494191242180517, 'fraction_numerical': 0.0071492403932082215, 'mean_word_length': 3.40748031496063, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 6, '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': '73275', 'n_tokens_mistral': 728, 'n_tokens_neox': 711, 'n_words': 150}