<commit_before># -*- coding: utf-8 -*-

import ctypes
import ctypes.util
from ctypes import *
import warnings
import os
import json

def load_library():
    cwd = os.path.dirname(os.path.abspath(__file__))
    libdir = os.path.join(cwd, "_phantompy.so")
    return ctypes.CDLL(libdir)


try:
    _library = load_library()
    # Context methods
    _library.ph_context_init.argtypes = []
    _library.ph_context_init.restype = c_void_p

    _library.ph_context_free.argtypes = []
    _library.ph_context_free.restype = None

    _library.ph_context_process_events.argtypes = [c_int]
    _library.ph_context_process_events.restype = None<commit_msg>Now python wrapper search system wide a libphantompy<commit_after># -*- coding: utf-8 -*-

import ctypes
import ctypes.util
from ctypes import *
import warnings
import os
import json

def load_library():
    libpath = ctypes.util.find_library('phantompy')
    return ctypes.CDLL(libpath)


try:
    _library = load_library()
    # Context methods
    _library.ph_context_init.argtypes = []
    _library.ph_context_init.restype = c_void_p

    _library.ph_context_free.argtypes = []
    _library.ph_context_free.restype = None

    _library.ph_context_process_events.argtypes = [c_int]
    _library.ph_context_process_events.restype = None
{'fraction_non_alphanumeric': 0.09571984435797666, 'fraction_numerical': 0.0015564202334630351, 'mean_word_length': 4.043137254901961, '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': '1950952', 'n_tokens_mistral': 440, 'n_tokens_neox': 430, 'n_words': 83}