<commit_before>   # -*- coding:utf-8 -*-
#-----------------------------------------------------------------------------
#  Copyright (c) 2015, ROOT Team.
#  Authors: <NAME>
#           <NAME> <<EMAIL>> http://oproject.org
#  Distributed under the terms of the Modified LGPLv3 License.
#
#  The full license is in the file COPYING.rst, distributed with this software.
#-----------------------------------------------------------------------------
from ctypes import CDLL, c_char_p
from threading import Thread
from time import sleep as timeSleep
from resource import setrlimit, RLIMIT_STACK, RLIM_INFINITY
from sys import platform

_lib = CDLL("libJupyROOT.so")

class IOHandler(object):
    r'''Class used to capture output from C/C++ libraries.
    >>> import sys
    >>> h = IOHandler()
    >>> h.GetStdout()
    ''
    >>> h.GetStderr()
    ''
    >>> h.GetStreamsDicts()
    (None, None)
    >>> del h
    '''
    def __init__(self):
        for cfunc in [_lib.JupyROOTExecutorHandler_GetStdout,
                      _lib.JupyROOTExecutorHandler_GetStderr]:
           cfunc.restype = c_char_p
        _lib.JupyROOTExecutorHandler_Ctor()

    def __del__(self):
        _lib.JupyROOTExecutorHandler_Dtor()

    def Clear(self):
        _lib.JupyROOTExecutorHandler_Clear()

    def Poll(self):
        _lib.JupyROOTExecutorHandler_Poll()

    def InitCapture(self):
        _lib.JupyROOTExecutorHandler_InitCapture()
<commit_msg>Use full path for loading CDLL<commit_after>   # -*- coding:utf-8 -*-
#-----------------------------------------------------------------------------
#  Copyright (c) 2015, ROOT Team.
#  Authors: <NAME>
#           <NAME> <<EMAIL>> http://oproject.org
#  Distributed under the terms of the Modified LGPLv3 License.
#
#  The full license is in the file COPYING.rst, distributed with this software.
#-----------------------------------------------------------------------------
from ctypes import CDLL, c_char_p
from threading import Thread
from time import sleep as timeSleep
from resource import setrlimit, RLIMIT_STACK, RLIM_INFINITY
from sys import platform
from os import path

_lib = CDLL(path.join(path.dirname(path.dirname(__file__)), 'libJupyROOT.so'))

class IOHandler(object):
    r'''Class used to capture output from C/C++ libraries.
    >>> import sys
    >>> h = IOHandler()
    >>> h.GetStdout()
    ''
    >>> h.GetStderr()
    ''
    >>> h.GetStreamsDicts()
    (None, None)
    >>> del h
    '''
    def __init__(self):
        for cfunc in [_lib.JupyROOTExecutorHandler_GetStdout,
                      _lib.JupyROOTExecutorHandler_GetStderr]:
           cfunc.restype = c_char_p
        _lib.JupyROOTExecutorHandler_Ctor()

    def __del__(self):
        _lib.JupyROOTExecutorHandler_Dtor()

    def Clear(self):
        _lib.JupyROOTExecutorHandler_Clear()

    def Poll(self):
        _lib.JupyROOTExecutorHandler_Poll()

    def InitCapture(self):
        _lib.JupyROOTExecutorHandler_InitCapture()

{'fraction_non_alphanumeric': 0.20108327691266079, 'fraction_numerical': 0.004062288422477996, 'mean_word_length': 2.078125, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 47, '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': '5269049', 'n_tokens_mistral': 890, 'n_tokens_neox': 861, 'n_words': 216}