<commit_before>#lang racket
(require casio/alternative)
(require casio/programs)
(require casio/matcher)
(require casio/points)
(require casio/common)
(require casio/redgreen)

(provide plausible-alts best-combination)
;; This value is entirely arbitrary and should probably be changed,
;; before it destroys something.
(define *branch-cost* 5)

;; A lexically scoped predicate that is true on the top level,
;; but if you're in code that was called because you were trying
;; to improve one of the branches of a conditional, then it is
;; a predicate returning true to points that will go to your part
;; of the branch, and false to points that won't. This predicate
;; takes the form of a racket expression which must be evaluated to be called.
(define *point-pred* (make-parameter (const #t)))

;; Basically matrix flipping, but for lists. So, if you pass it '((1 2 3) (4 5 6) (7 8 9)),
;; it returns '((1 4 7) (2 5 8) (3 6 9)).
(define (flip-lists list-list)
  (apply map list list-list))

;; This constant determines how aggressive our filtration is.
;; Higher values mean we will filter more aggresively, and might
;; accidentally filter out a good option.
(define *plausibility-min-region-size* 3)

;; Works like ormap, except instead of returning true if
;; any invocation of pred returns true, it returns true only
;; if at least reg-size invocations return true in a row.
(define (region-ormap pred reg-size . lsts)<commit_msg>Changed combine-alts API<commit_after>#lang racket
(require casio/alternative)
(require casio/programs)
(require casio/matcher)
(require casio/points)
(require casio/common)
(require casio/redgreen)

(provide plausible-alts combine-alts)
;; This value is entirely arbitrary and should probably be changed,
;; before it destroys something.
(define *branch-cost* 5)

;; A lexically scoped predicate that is true on the top level,
;; but if you're in code that was called because you were trying
;; to improve one of the branches of a conditional, then it is
;; a predicate returning true to points that will go to your part
;; of the branch, and false to points that won't. This predicate
;; takes the form of a racket expression which must be evaluated to be called.
(define *point-pred* (make-parameter (const #t)))

;; Basically matrix flipping, but for lists. So, if you pass it '((1 2 3) (4 5 6) (7 8 9)),
;; it returns '((1 4 7) (2 5 8) (3 6 9)).
(define (flip-lists list-list)
  (apply map list list-list))

;; This constant determines how aggressive our filtration is.
;; Higher values mean we will filter more aggresively, and might
;; accidentally filter out a good option.
(define *plausibility-min-region-size* 3)

;; Works like ormap, except instead of returning true if
;; any invocation of pred returns true, it returns true only
;; if at least reg-size invocations return true in a row.
(define (region-ormap pred reg-size . lsts)
{'fraction_non_alphanumeric': 0.09406456091634849, 'fraction_numerical': 0.013884068031933356, 'mean_word_length': 4.458333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?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': '198989', 'n_tokens_mistral': 880, 'n_tokens_neox': 808, 'n_words': 421}