<commit_before>let printers =
  [
    "Lacaml.Io.pp_fvec";
    "Lacaml.Io.pp_cvec";
    "Lacaml.Io.pp_ivec";
    "Lacaml.Io.pp_fmat";
    "Lacaml.Io.pp_cmat";
    "Lacaml.Io.pp_imat";
  ]

let eval_string
      ?(print_outcome = false) ?(err_formatter = Format.err_formatter) str =
  let lexbuf = Lexing.from_string str in
  let phrase = !Toploop.parse_toplevel_phrase lexbuf in
  Toploop.execute_phrase print_outcome err_formatter phrase

let rec install_printers = function
  | [] -> true
  | printer :: printers ->
      let cmd = Printf.sprintf "#install_printer %s;;" printer in
      eval_string cmd && install_printers printers

let () =
  if not (install_printers printers) then
    Format.eprintf "Problem installing LACAML-printers@."<commit_msg>Turned on context printing by default in toplevel<commit_after>let printers =
  [
    "Lacaml.Io.pp_fvec";
    "Lacaml.Io.pp_cvec";
    "Lacaml.Io.pp_ivec";
    "Lacaml.Io.pp_fmat";
    "Lacaml.Io.pp_cmat";
    "Lacaml.Io.pp_imat";
  ]

let eval_string
      ?(print_outcome = false) ?(err_formatter = Format.err_formatter) str =
  let lexbuf = Lexing.from_string str in
  let phrase = !Toploop.parse_toplevel_phrase lexbuf in
  Toploop.execute_phrase print_outcome err_formatter phrase

let rec install_printers = function
  | [] -> true
  | printer :: printers ->
      let cmd = Printf.sprintf "#install_printer %s;;" printer in
      eval_string cmd && install_printers printers

let set_contexts () =
  let cmd = 
    "Lacaml.Io.Context.set_dim_defaults (Some (Lacaml.Io.Context.create 5));;"
  in
  eval_string cmd

let () =
  if not (install_printers printers && set_contexts ()) then
    Format.eprintf "Problem installing LACAML-printers@."
{'fraction_non_alphanumeric': 0.11143695014662756, 'fraction_numerical': 0.0005865102639296188, 'mean_word_length': 3.64850136239782, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1424418', 'n_tokens_mistral': 639, 'n_tokens_neox': 614, 'n_words': 132}