<commit_before># frozen_string_literal: true
require "set"
require "rantly"
require "rantly/property"
require "rantly/shrinks"
require "concurrent/delay"
require "date"
require "securerandom"
require "uri"
require "date"
require "time"

module Speculation
  using NamespacedSymbols.refine(self)

  module Gen
    # @private
    GEN_BUILTINS = {
      Integer    => ->(r) { r.integer },
      String     => ->(r) { r.sized(r.range(0, 20)) { string(:alpha) } },
      Float      => ->(_r) { rand(Float::MIN..Float::MAX) },
      Numeric    => ->(r) { r.branch(Gen.gen_for_pred(Integer), Gen.gen_for_pred(Float)) },
      Symbol     => ->(r) { r.sized(r.range(0, 20)) { string(:alpha).to_sym } },
      TrueClass  => ->(_r) { true },
      FalseClass => ->(_r) { false },
      NilClass   => ->(_r) { nil },
      Date       => ->(_r) { Speculation.gen(Speculation.date_in(Date.new(1970, 1, 1)..Date.new(3000, 1, 1))) },
      Time       => ->(_r) { Speculation.gen(Speculation.time_in(Time.new(1970, 1, 1)..Time.new(3000, 1, 1))) },
      URI        => ->(_r) { URI("http://#{SecureRandom.uuid}.com") },
      Array      => ->(r) do
        size = r.range(0, 20)

        r.array(size) do
          gen = Gen.gen_for_pred(r.choose(Integer, String, Float, Symbol, Date, Time, Set[true, false]))
          gen.call(r)<commit_msg>Fix Date + Time default gens<commit_after># frozen_string_literal: true
require "set"
require "rantly"
require "rantly/property"
require "rantly/shrinks"
require "concurrent/delay"
require "date"
require "securerandom"
require "uri"
require "date"
require "time"

module Speculation
  using NamespacedSymbols.refine(self)

  module Gen
    # @private
    GEN_BUILTINS = {
      Integer    => ->(r) { r.integer },
      String     => ->(r) { r.sized(r.range(0, 20)) { string(:alpha) } },
      Float      => ->(_r) { rand(Float::MIN..Float::MAX) },
      Numeric    => ->(r) { r.branch(Gen.gen_for_pred(Integer), Gen.gen_for_pred(Float)) },
      Symbol     => ->(r) { r.sized(r.range(0, 20)) { string(:alpha).to_sym } },
      TrueClass  => ->(_r) { true },
      FalseClass => ->(_r) { false },
      NilClass   => ->(_r) { nil },
      Date       => Speculation.gen(Speculation.date_in(Date.new(1970, 1, 1)..Date.new(3000, 1, 1))),
      Time       => Speculation.gen(Speculation.time_in(Time.new(1970, 1, 1)..Time.new(3000, 1, 1))),
      URI        => ->(_r) { URI("http://#{SecureRandom.uuid}.com") },
      Array      => ->(r) do
        size = r.range(0, 20)

        r.array(size) do
          gen = Gen.gen_for_pred(r.choose(Integer, String, Float, Symbol, Date, Time, Set[true, false]))
          gen.call(r)
{'fraction_non_alphanumeric': 0.19182746878547105, 'fraction_numerical': 0.024971623155505107, 'mean_word_length': 2.745042492917847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 49, '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': '1965223', 'n_tokens_mistral': 1003, 'n_tokens_neox': 937, 'n_words': 191}