<commit_before>def notify(type = :success, string)
  color = case type
  when :success
    :green
  when :failure
    :red
  when :warning
    :yellow
  when :info
    :light_blue
  else
    ''
  end
  puts "[#{type.to_s.capitalize.colorize(color)}] #{string}"
end

def get_job_file(for_job:)
  for_job = "#{__dir__}/../../jobs/#{for_job}.yaml"
  if for_job.nil?
    notify :failure, 'Please specify the job to create or edit. See --help for details'
    nil
  else
    File.expand_path for_job
  end
end

def create_and_edit(file, with_default: '')
  file = File.expand_path file
  unless File.file?(file)
    File.write file, with_default
    notify :success, "Created new file '#{file}'"
  end
  notify :info, "Manually editing file '#{file}'"
  system ENV['EDITOR'], file
end<commit_msg>sudo doesn't have nano, needs a sane default<commit_after>def notify(type = :success, string)
  color = case type
  when :success
    :green
  when :failure
    :red
  when :warning
    :yellow
  when :info
    :light_blue
  else
    ''
  end
  puts "[#{type.to_s.capitalize.colorize(color)}] #{string}"
end

def get_job_file(for_job:)
  for_job = "#{__dir__}/../../jobs/#{for_job}.yaml"
  if for_job.nil?
    notify :failure, 'Please specify the job to create or edit. See --help for details'
    nil
  else
    File.expand_path for_job
  end
end

def edit(file)
  edit = ENV['EDITOR']
  if edit
    notify :info, "Manually editing file '#{file}'"
    system edit, file
  else
    notify :failure, "No editor specified in $EDITOR environment variable"
    notify :info, "Displaying file contents instead"
    system 'cat', file
  end
end

def create_and_edit(file, with_default: '')
  file = File.expand_path file
  unless File.file?(file)
    File.write file, with_default
    notify :success, "Created new file '#{file}'"
  end
  edit file
end
{'fraction_non_alphanumeric': 0.12030484485574305, 'fraction_numerical': 0.0, 'mean_word_length': 3.324705882352941, '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': '7344866', 'n_tokens_mistral': 636, 'n_tokens_neox': 629, 'n_words': 193}