<commit_before>from pymatbridge import Matlab
import os

mlab = Matlab()
mlab.start()
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_list = ['/Input_data', '/HHT_MATLAB_package', '/HHT_MATLAB_package/EMD',
          '/HHT_MATLAB_package/checkIMFs', '/HHT_MATLAB_package/HT']
for d in dir_list:
    res = mlab.run_func('addpath', dir_path + d)

class EEMD():
    def __init__(self, signal, Nstd, NE, num_imf=10, run_CEEMD=1, max_sift=10,
                 type_spline=2, modify_BC=1, rand_type=2, seed_no=1,
                 check_signal=1, post_processing=True):
        if post_processing == True:
            eemd = 'feemd_post_pro'
        else:
            eemd = 'eemd'
        res = mlab.run_func(eemd, signal, Nstd, NE, num_imf,
                            run_CEEMD, max_sift, type_spline, modify_BC,
                            rand_type, seed_no, check_signal)
        if post_processing == True:
            self.imfs = res['result'].T
        else:
            self.imfs = res['result']


    def get_oi(self):
        oi = mlab.run_func('ratio1', self.imfs.T)
        oi_pair = mlab.run_func('ratioa', self.imfs.T)
        oi_dic = {'Non-orthogonal leakage of components': oi['result'],
                  'Non-orthogonal leakage for pair of adjoining components': oi_pair['result']}
        return oi_dic
<commit_msg>change default value of post_processing<commit_after>from pymatbridge import Matlab
import os

mlab = Matlab()
mlab.start()
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_list = ['/Input_data', '/HHT_MATLAB_package', '/HHT_MATLAB_package/EMD',
          '/HHT_MATLAB_package/checkIMFs', '/HHT_MATLAB_package/HT']
for d in dir_list:
    res = mlab.run_func('addpath', dir_path + d)

class EEMD():
    def __init__(self, signal, Nstd, NE, num_imf=10, run_CEEMD=1, max_sift=10,
                 type_spline=2, modify_BC=1, rand_type=2, seed_no=1,
                 check_signal=1, post_processing=False):
        if post_processing == True:
            eemd = 'feemd_post_pro'
        else:
            eemd = 'eemd'
        res = mlab.run_func(eemd, signal, Nstd, NE, num_imf,
                            run_CEEMD, max_sift, type_spline, modify_BC,
                            rand_type, seed_no, check_signal)
        if post_processing == True:
            self.imfs = res['result'].T
        else:
            self.imfs = res['result']


    def get_oi(self):
        oi = mlab.run_func('ratio1', self.imfs.T)
        oi_pair = mlab.run_func('ratioa', self.imfs.T)
        oi_dic = {'Non-orthogonal leakage of components': oi['result'],
                  'Non-orthogonal leakage for pair of adjoining components': oi_pair['result']}
        return oi_dic

{'fraction_non_alphanumeric': 0.11960132890365449, 'fraction_numerical': 0.008121077888519748, 'mean_word_length': 2.4610472541507025, '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': '4512546', 'n_tokens_mistral': 977, 'n_tokens_neox': 946, 'n_words': 192}