<commit_before>
module DelimCC
    def metacc_get
        tmp = Thread.current["__meta_cc__"]
        if !tmp
            proc { raise "not within a reset statement" }
        else
            tmp
        end
    end

    def metacc_set(&m)
        Thread.current["__meta_cc__"] = m
    end


    def abortcc(&blk)
        v = blk.call
        metacc_get.call v
    end

    def reset(&blk)
        callcc do |k|
            m = metacc_get
            metacc_set {|r|
                metacc_set &m
                k.call r
            }
            abortcc &blk
        end
    end

    def shift(&blk)
        callcc do |k|
            abortcc do
                blk.call proc {|x|
                    reset { k.call x }
                }
            end
        end
    end

end
<commit_msg>little "cleanup" after using reek<commit_after>
module DelimCC
    def metacc_get
        tmp = Thread.current["__meta_cc__"]
        if !tmp
            proc { raise "not within a reset statement" }
        else
            tmp
        end
    end

    def metacc_set(&meta_cont)
        Thread.current["__meta_cc__"] = meta_cont
    end


    def abortcc(&blk)
        value = blk.call
        metacc_get.call value
    end

    def reset(&blk)
        callcc do |cont|
            meta_cont = metacc_get
            metacc_set {|value|
                metacc_set &meta_cont
                cont.call value
            }
            abortcc &blk
        end
    end

    def shift(&blk)
        callcc do |cont|
            abortcc do
                blk.call proc {|value|
                    reset { cont.call value }
                }
            end
        end
    end

end

{'fraction_non_alphanumeric': 0.06690561529271206, 'fraction_numerical': 0.0, 'mean_word_length': 1.0963704630788487, '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': '4960140', 'n_tokens_mistral': 511, 'n_tokens_neox': 491, 'n_words': 136}