<commit_before>#!/usr/bin/env ruby
require 'yaml'

KNOWS_FILE = Dir.pwd + '/django/src/www/eventbrite/common/automation/webdriver/static_files/knows_out.yml'

# Slurp the YAML file, die if something goes wrong
begin
    data = YAML::load(File.read(KNOWS_FILE))
rescue Exception => e
    puts "Something went wrong with parsing the knows file"
    exit 1
end
# Print out all the relavant tests, or all if there's a lot.
if !ARGV[0].empty?
    # Collect all the tests from the YAML
    tests = ARGV.map{ | file | data[file] }.compact()
    if !tests[0].nil? and tests[0].length < 50
        puts "The following acceptance tests are affected by your changes\n"
        tests[0].each do | test |
            puts "- #{test}"
        end
    else
        puts "Your changes affect almost everything. I suggest you run all tests in Sauce"
    end
    exit 0
else
    puts "Error: Nothing was passed to this script"
    exit 1
end

<commit_msg>No message in yaml-parser.rb if there are no tests to run.<commit_after>#!/usr/bin/env ruby
require 'yaml'

KNOWS_FILE = Dir.pwd + '/django/src/www/eventbrite/common/automation/webdriver/static_files/knows_out.yml'

# Slurp the YAML file, die if something goes wrong
begin
    data = YAML::load(File.read(KNOWS_FILE))
rescue Exception => e
    puts "Something went wrong with parsing the knows file"
    exit 1
end
# Print out all the relavant tests, or all if there's a lot.
if !ARGV[0].empty?
    # Collect all the tests from the YAML
    tests = ARGV.map{ | file | data[file] }.compact()
    if tests[0].nil?
        # No tests to run, simply exit.
        exit 0
    elsif tests[0].length < 50
        puts "The following acceptance tests are affected by your changes\n"
        tests[0].each do | test |
            puts "- #{test}"
        end
    else
        puts "Your changes affect almost everything. I suggest you run all tests in Sauce"
    end
    exit 0
else
    puts "Error: Nothing was passed to this script"
    exit 1
end


{'fraction_non_alphanumeric': 0.09247094492167761, 'fraction_numerical': 0.009600808489135927, 'mean_word_length': 2.76425855513308, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2362816', 'n_tokens_mistral': 652, 'n_tokens_neox': 626, 'n_words': 240}