<commit_before># frozen_string_literal: true

# This is a Ruby translation of clojure.spec:
#   https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
# All credit belongs with <NAME> and contributors for their original work.

require "concurrent"
require "set"
require "securerandom"

require "speculation/version"
require "speculation/namespaced_symbols"
require "speculation/method_identifier"
require "speculation/utils"
require "speculation/predicates"
require "speculation/spec"
require "speculation/error"

module Speculation
  extend NamespacedSymbols

  class << self
    # Enables or disables spec asserts. Defaults to false.
    attr_accessor :check_asserts

    # A soft limit on how many times a branching spec (or/alt/zero_or_more) can
    # be recursed through during generation.  After this a non-recursive branch
    # will be chosen.
    attr_accessor :recursion_limit

    # The number of times an anonymous fn specified by fspec will be
    # (generatively) tested during conform.
    attr_accessor :fspec_iterations

    # The number of elements validated in a collection spec'ed with 'every'.
    attr_accessor :coll_check_limit

    # The number of errors reported by explain in a collection spec'ed with
    # 'every'
    attr_accessor :coll_error_limit
  end

  @check_asserts    = ENV["SPECULATION_CHECK_ASSERTS"] == "true"
  @recursion_limit  = 4
  @fspec_iterations = 21
  @coll_check_limit = 101
  @coll_error_limit = 20

  @registry_ref = Concurrent::Atom.new({})

  # Can be enabled or disabled at runtime:
  # - enabled/disabled by setting `check_asserts`.
  # - enabled by setting environment variable SPECULATION_CHECK_ASSERTS to the<commit_msg>mention opt keys uses recursion_limit during gen<commit_after># frozen_string_literal: true

# This is a Ruby translation of clojure.spec:
#   https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
# All credit belongs with <NAME> and contributors for their original work.

require "concurrent"
require "set"
require "securerandom"

require "speculation/version"
require "speculation/namespaced_symbols"
require "speculation/method_identifier"
require "speculation/utils"
require "speculation/predicates"
require "speculation/spec"
require "speculation/error"

module Speculation
  extend NamespacedSymbols

  class << self
    # Enables or disables spec asserts. Defaults to false.
    attr_accessor :check_asserts

    # A soft limit on how many times a branching spec (or/alt/zero_or_more/opt keys) can be recursed
    # through during generation. After this a non-recursive branch will be chosen.
    attr_accessor :recursion_limit

    # The number of times an anonymous fn specified by fspec will be
    # (generatively) tested during conform.
    attr_accessor :fspec_iterations

    # The number of elements validated in a collection spec'ed with 'every'.
    attr_accessor :coll_check_limit

    # The number of errors reported by explain in a collection spec'ed with
    # 'every'
    attr_accessor :coll_error_limit
  end

  @check_asserts    = ENV["SPECULATION_CHECK_ASSERTS"] == "true"
  @recursion_limit  = 4
  @fspec_iterations = 21
  @coll_check_limit = 101
  @coll_error_limit = 20

  @registry_ref = Concurrent::Atom.new({})

  # Can be enabled or disabled at runtime:
  # - enabled/disabled by setting `check_asserts`.
  # - enabled by setting environment variable SPECULATION_CHECK_ASSERTS to the
{'fraction_non_alphanumeric': 0.07290755322251385, 'fraction_numerical': 0.004666083406240887, 'mean_word_length': 4.301391035548686, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1024419', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1014, 'n_words': 334}