<commit_before>
#include "python_script.h"

#include <cstdio>
#include <fstream>
#include <iterator>

#include <glog/logging.h>

#include <boost/python.hpp>
#include <Python.h>

#include "swganh/swganh_binding.cc"

using namespace boost::python;
using namespace std;
using namespace swganh::scripting;

PythonScript::PythonScript(const string& filename)
        : filename_(filename)
{
    ReadFileContents();

    Py_Initialize();
    
	try
    {

		PyInit_swganh_binding();
		
		boost::python::object main = boost::python::object (boost::python::handle<>(boost::python::borrowed(
			PyImport_AddModule("__main__")
		)));

        globals_ = main.attr("__dict__");
		globals_["context"] = dict();
    } 
    catch (error_already_set &) 
    {
        PyErr_Print();
    }
}

void PythonScript::Run()
{
	try
    {
#ifdef _DEBUG<commit_msg>Removed linking errors<commit_after>
#include "python_script.h"

#include <cstdio>
#include <fstream>
#include <iterator>

#include <glog/logging.h>

#include <boost/python.hpp>
#include <Python.h>

using namespace boost::python;
using namespace std;
using namespace swganh::scripting;

PythonScript::PythonScript(const string& filename)
        : filename_(filename)
{
    ReadFileContents();

    Py_Initialize();
    
	try
    {		
		boost::python::object main = boost::python::object (boost::python::handle<>(boost::python::borrowed(
			PyImport_AddModule("__main__")
		)));

        globals_ = main.attr("__dict__");
        globals_["swganh"] = boost::python::import("swganh_binding");
		globals_["context"] = dict();
    } 
    catch (error_already_set &) 
    {
        PyErr_Print();
    }
}

void PythonScript::Run()
{
	try
    {
#ifdef _DEBUG
{'fraction_non_alphanumeric': 0.14902424600827913, 'fraction_numerical': 0.0, 'mean_word_length': 4.158536585365853, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '1543429', 'n_tokens_mistral': 599, 'n_tokens_neox': 567, 'n_words': 102}