<commit_before><?php
  function getDatabaseConnection() {
    static $connection;

    if (!isset($connection)) {
      $db = require 'databaseConfig.php'; // {host, name, user, pass}
      $dsn = "mysql:host={$db['host']};dbname={$db['name']};charset=utf8";
      $opt = [
          PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
          PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
          PDO::ATTR_EMULATE_PREPARES   => false,
      ];
      $connection = new PDO($dsn, $db['user'], $db['pass'], $opt);
    }

    return $connection;
  }


  function query($sql, $params=[]) {
    $pdo = getDatabaseConnection();
    $stmt = $pdo->prepare($sql);
    $stmt->execute($params);
	
	$results = '';
	
	try {
		$results = $stmt->fetchAll();
	} catch (Exception $e) {
    	// echo 'Caught exception: ',  $e->getMessage(), "\n";
	}
    
    
	
	return $results;
  }

?>
<commit_msg>Changed database<commit_after><?php
  function getDatabaseConnection() {
    static $connection;

    if (!isset($connection)) {
      $db = require 'databaseConfig.php'; // {host, name, user, pass}
      $dsn = "mysql:host={$db['host']};dbname={$db['name']};charset=utf8";
      $opt = [
          PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
          PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
          PDO::ATTR_EMULATE_PREPARES   => false,
      ];
      $connection = new PDO($dsn, $db['user'], $db['pass'], $opt);
    }

    return $connection;
  }


  function query($sql, $params=[]) {
    $pdo = getDatabaseConnection();
    $stmt = $pdo->prepare($sql);
    $stmt->execute($params);
	
	$results = '';
	
	try {
		$results = $stmt->fetchAll();
	} catch (Exception $e) {
    	    echo 'Caught exception: ',  $e->getMessage(), "\n";
	}
    
    
	
	return $results;
  }

?>

{'fraction_non_alphanumeric': 0.18502673796791444, 'fraction_numerical': 0.0010695187165775401, 'mean_word_length': 2.420475319926874, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '5872409', 'n_tokens_mistral': 678, 'n_tokens_neox': 628, 'n_words': 107}