<commit_before><?php
  global $path;

  // energyaudit module needs to be installed:
  echo "<script type='text/javascript' src='".$path."Modules/energydata/stack_lib/stacks.js'></script>"; 

  // Widget renderer 
  echo "<script type='text/javascript' src='".$path."Modules/dashboard/Views/js/widgets/stack/stack_render.js'></script>";  
?><commit_msg>changes to make stack widget work with new energy module<commit_after><?php

  global $session, $path;

  // energyaudit module needs to be installed:
  echo "<script type='text/javascript' src='".$path."Modules/energy/stack_lib/stacks.js'></script>"; 
  echo "<script type='text/javascript' src='".$path."Modules/energy/stack_lib/stack_prepare.js'></script>";
  // Widget renderer 
  echo "<script type='text/javascript' src='".$path."Modules/dashboard/Views/js/widgets/stack/stack_render.js'></script>";  

  include "Modules/energy/energy_model.php";
  include "Modules/energy/energytypes.php";

  $energyitems = energy_get_year($session['userid'], 2012);
?>

<script>
  var energyitems = <?php echo json_encode($energyitems); ?>;
  var energytypes = <?php echo json_encode($energytypes); ?>;

  order_energyitems();

  for (z in energyitems)
  {
    energyitems[z]['data'] = JSON.parse(energyitems[z]['data'] || "null");
  }

  var stacks = prepare_stack();

</script>

<?php

?>
{'fraction_non_alphanumeric': 0.17964071856287425, 'fraction_numerical': 0.0029940119760479044, 'mean_word_length': 4.864035087719298, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '2542808', 'n_tokens_mistral': 437, 'n_tokens_neox': 429, 'n_words': 83}