<commit_before>#define ALLOW_IMPORT_ARRAY
#include "python_statec.h"

void python_init_(void){
#ifdef HAVE_PYTHON
  // Initialize the Python interpreter
  Py_Initialize();
  PyRun_SimpleString("import string");  
#endif
#ifdef HAVE_NUMPY
  // Enable use of NumPy arrays in C
  import_array();

  // Import the NumPy module in our Python interpreter
  if(PyRun_SimpleString("import numpy") == -1)
    fprintf(stderr,"Error: Importing the NumPy module failed.\n");

  // Initialize a persistent dictionary
  PyRun_SimpleString("persistent = {}");

  init_vars();<commit_msg>Cause python modules in the working directory to be visible to python<commit_after>#define ALLOW_IMPORT_ARRAY
#include "python_statec.h"

void python_init_(void){
#ifdef HAVE_PYTHON
  // Initialize the Python interpreter
  Py_Initialize();
  PyRun_SimpleString("import string");  
#endif
#ifdef HAVE_NUMPY
  // Enable use of NumPy arrays in C
  import_array();

  // Import the NumPy module in our Python interpreter
  if(PyRun_SimpleString("import numpy") == -1)
    fprintf(stderr,"Error: Importing the NumPy module failed.\n");

  // Initialize a persistent dictionary
  PyRun_SimpleString("persistent = {}");

  // Add the working directory to the module search path.
  PyRun_SimpleString("import sys");
  PyRun_SimpleString("sys.path.append('.')");
  
  init_vars();
{'fraction_non_alphanumeric': 0.10722263588979895, 'fraction_numerical': 0.0014892032762472078, 'mean_word_length': 4.743589743589744, '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': '6477419', 'n_tokens_mistral': 405, 'n_tokens_neox': 400, 'n_words': 120}