<commit_before><?php
  /*
   All Emoncms code is released under the GNU Affero General Public License.
   See COPYRIGHT.txt and LICENSE.txt.

    ---------------------------------------------------------------------
    Emoncms - open source energy visualisation
    Part of the OpenEnergyMonitor project:
    http://openenergymonitor.org
  */

  function create_user_statistics($userid)
  {
    db_query("INSERT INTO statistics (`userid`,`uphits`,`dnhits`,`memory`) VALUES ('$userid','0','0','0')");
  }

  function set_memory_statistics($userid,$memory)
  {
    db_query("UPDATE statistics SET memory = '$memory' WHERE userid='$userid'");
  }

  function inc_uphits_statistics($userid)
  {
    db_query("update statistics SET uphits = uphits + 1 WHERE userid='$userid'");
  }

  function inc_dnhits_statistics($userid)
  {
    db_query("update statistics SET dnhits = dnhits + 1 WHERE userid='$userid'");
  }

  function get_statistics($userid)
  {
    $result = db_query("SELECT * FROM statistics WHERE userid='$userid'");
    $result = db_fetch_array($result);
    return $result;
  }<commit_msg>minor addition<commit_after><?php
  /*
   All Emoncms code is released under the GNU Affero General Public License.
   See COPYRIGHT.txt and LICENSE.txt.

    ---------------------------------------------------------------------
    Emoncms - open source energy visualisation
    Part of the OpenEnergyMonitor project:
    http://openenergymonitor.org
  */

  function create_user_statistics($userid)
  {
    db_query("INSERT INTO statistics (`userid`,`uphits`,`dnhits`,`memory`) VALUES ('$userid','0','0','0')");
  }

  function set_memory_statistics($userid,$memory)
  {
    db_query("UPDATE statistics SET memory = '$memory' WHERE userid='$userid'");
  }

  function inc_uphits_statistics($userid)
  {
    db_query("update statistics SET uphits = uphits + 1 WHERE userid='$userid'");
  }

  function inc_dnhits_statistics($userid)
  {
    db_query("update statistics SET dnhits = dnhits + 1 WHERE userid='$userid'");
  }

  function get_statistics($userid)
  {
    $result = db_query("SELECT * FROM statistics WHERE userid='$userid'");
    $result = db_fetch_array($result);

    if (!$result)
    {
      db_query("INSERT INTO statistics (`userid`,`uphits`,`dnhits`,`memory`) VALUES ('$userid','0','0','0')");
    }

    return $result;
  }
{'fraction_non_alphanumeric': 0.1885665529010239, 'fraction_numerical': 0.005546075085324232, 'mean_word_length': 3.1431095406360425, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7361488', 'n_tokens_mistral': 759, 'n_tokens_neox': 717, 'n_words': 163}