<commit_before>'''
    LeenO menu and basic function dispatcher
'''

import sys
import os
import inspect
import importlib

from os import listdir
from os.path import isfile, join

import unohelper
from com.sun.star.task import XJobExecutor


# set this one to 0 for deploy mode
# leave to 1 if you want to disable python cache
# to be able to modify and run installed extension
DISABLE_CACHE = 1


def fixPythonPath():
    '''
    This function should fix python path adding it to current sys path
    if not already there
    Useless here, just kept for reference
    '''
    # dirty trick to have pythonpath added if missing
    myPath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
    myPath = os.path.join(myPath, "pythonpath")
    if myPath not in sys.path:
        sys.path.append(myPath)


def reloadLeenoModules():
    '''
    This function reload all Leeno modules found in pythonpath
    '''
    # get our pythonpath
    myPath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
    myPath = os.path.join(myPath, "pythonpath")

    # we need a listing of modules. We look at pythonpath ones
    pythonFiles = [f[: -3] for f in listdir(myPath) if isfile(join(myPath, f)) and f.endswith(".py")]

    for f in pythonFiles:
        print("Loading module:", f)
        module = importlib.import_module(f)

        # reload the module
        importlib.reload(module)<commit_msg>Commenta il print di reloadLeenoModules()<commit_after>'''
    LeenO menu and basic function dispatcher
'''

import sys
import os
import inspect
import importlib

from os import listdir
from os.path import isfile, join

import unohelper
from com.sun.star.task import XJobExecutor


# set this one to 0 for deploy mode
# leave to 1 if you want to disable python cache
# to be able to modify and run installed extension
DISABLE_CACHE = 1


def fixPythonPath():
    '''
    This function should fix python path adding it to current sys path
    if not already there
    Useless here, just kept for reference
    '''
    # dirty trick to have pythonpath added if missing
    myPath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
    myPath = os.path.join(myPath, "pythonpath")
    if myPath not in sys.path:
        sys.path.append(myPath)


def reloadLeenoModules():
    '''
    This function reload all Leeno modules found in pythonpath
    '''
    # get our pythonpath
    myPath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
    myPath = os.path.join(myPath, "pythonpath")

    # we need a listing of modules. We look at pythonpath ones
    pythonFiles = [f[: -3] for f in listdir(myPath) if isfile(join(myPath, f)) and f.endswith(".py")]
    for f in pythonFiles:
        #~ print("Loading module:", f)
        module = importlib.import_module(f)

        # reload the module
        importlib.reload(module)
{'fraction_non_alphanumeric': 0.08947006194081211, 'fraction_numerical': 0.0027529249827942187, 'mean_word_length': 3.3452914798206277, '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': '120367', 'n_tokens_mistral': 886, 'n_tokens_neox': 861, 'n_words': 317}