<commit_before>import AlphaTwirl
import unittest
import inspect

##__________________________________________________________________||
hasPandas = False
try:
    import pandas
    hasPandas = True
except ImportError:
    pass


##__________________________________________________________________||
hasROOT = False
try:
    import ROOT
    hasROOT = True
except ImportError:
    pass

##__________________________________________________________________||

class TestImport_01(unittest.TestCase):

    @unittest.skipUnless(hasPandas, "has no pandas")
    def test_with_pandas(self):
        self.assertTrue(inspect.isfunction(AlphaTwirl.Aggregate.combine_MC_yields_in_datasets_into_xsec_in_processes))
        self.assertTrue(inspect.isfunction(AlphaTwirl.Aggregate.stack_counts_categories))
        self.assertTrue(inspect.isfunction(AlphaTwirl.Aggregate.sumOverCategories))

        self.assertTrue(inspect.isfunction(AlphaTwirl.buildBinningFromTbl))

        self.assertTrue(inspect.isclass(AlphaTwirl.CombineIntoPandasDataFrame))
        self.assertTrue(inspect.isclass(AlphaTwirl.WritePandasDataFrameToFile))

    @unittest.skipUnless(hasROOT, "has no ROOT")
    def test_with_ROOT(self):
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.BEventBuilder))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.EventBuilder))

        self.assertTrue(inspect.isclass(AlphaTwirl.Events.BEvents))
        self.assertTrue(inspect.isclass(AlphaTwirl.Events.BranchAddressManagerForVector))

    def test_functions(self):
        self.assertTrue(inspect.isfunction(AlphaTwirl.mkdir_p))

    def test_classes(self):
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.Collector))
        self.assertTrue(inspect.isclass(AlphaTwirl.AlphaTwirl))
        self.assertTrue(inspect.isclass(AlphaTwirl.Binning.Binning))
        self.assertTrue(inspect.isclass(AlphaTwirl.Binning.Echo))
        self.assertTrue(inspect.isclass(AlphaTwirl.Binning.Round))
        self.assertTrue(inspect.isclass(AlphaTwirl.Binning.RoundLog))
        self.assertTrue(inspect.isclass(AlphaTwirl.Concurrently.CommunicationChannel))
        self.assertTrue(inspect.isclass(AlphaTwirl.Combine))
        self.assertTrue(inspect.isclass(AlphaTwirl.CombineIntoList))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.Counter))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.CounterFactory))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.Counts))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.GenericKeyComposer))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.GenericKeyComposerB))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.NextKeyComposer))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.Collector))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventLoop))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventLoopProgressReportWriter))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventLoopRunner))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventReaderBundle))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventReaderCollectorAssociator))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventReaderCollectorAssociatorComposite))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventReaderComposite))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.MPEventLoopRunner))
        self.assertTrue(inspect.isclass(AlphaTwirl.Events.Branch))
        self.assertTrue(inspect.isclass(AlphaTwirl.Events.BranchAddressManager))
        self.assertTrue(inspect.isclass(AlphaTwirl.Events.Events))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.Analyzer))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.Component))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.ComponentLoop))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.ComponentReaderComposite))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.HeppyResult))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.ReadComponentConfig))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.ReadCounter))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.ReadVersionInfo))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.TblCounter))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.TblXsec))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.ProgressBar))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.ProgressMonitor))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.ProgressReport))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.ProgressReporter))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.NullProgressMonitor))
        self.assertTrue(inspect.isclass(AlphaTwirl.WriteListToFile))

##________________________________._________________________________||<commit_msg>update TestImport_01<commit_after>import AlphaTwirl
import unittest
import inspect

##__________________________________________________________________||
hasPandas = False
try:
    import pandas
    hasPandas = True
except ImportError:
    pass


##__________________________________________________________________||
hasROOT = False
try:
    import ROOT
    hasROOT = True
except ImportError:
    pass

##__________________________________________________________________||

class TestImport_01(unittest.TestCase):

    @unittest.skipUnless(hasPandas, "has no pandas")
    def test_with_pandas(self):
        self.assertTrue(inspect.isfunction(AlphaTwirl.Aggregate.combine_MC_yields_in_datasets_into_xsec_in_processes))
        self.assertTrue(inspect.isfunction(AlphaTwirl.Aggregate.stack_counts_categories))
        self.assertTrue(inspect.isfunction(AlphaTwirl.Aggregate.sumOverCategories))

        self.assertTrue(inspect.isfunction(AlphaTwirl.buildBinningFromTbl))

        self.assertTrue(inspect.isclass(AlphaTwirl.CombineIntoPandasDataFrame))
        self.assertTrue(inspect.isclass(AlphaTwirl.WritePandasDataFrameToFile))

    @unittest.skipUnless(hasROOT, "has no ROOT")
    def test_with_ROOT(self):
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.BEventBuilder))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.EventBuilder))

        self.assertTrue(inspect.isclass(AlphaTwirl.Events.BEvents))
        self.assertTrue(inspect.isclass(AlphaTwirl.Events.BranchAddressManagerForVector))

    def test_functions(self):
        self.assertTrue(inspect.isfunction(AlphaTwirl.mkdir_p))

    def test_classes(self):
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.Collector))
        self.assertTrue(inspect.isclass(AlphaTwirl.AlphaTwirl))
        self.assertTrue(inspect.isclass(AlphaTwirl.Binning.Binning))
        self.assertTrue(inspect.isclass(AlphaTwirl.Binning.Echo))
        self.assertTrue(inspect.isclass(AlphaTwirl.Binning.Round))
        self.assertTrue(inspect.isclass(AlphaTwirl.Binning.RoundLog))
        self.assertTrue(inspect.isclass(AlphaTwirl.Concurrently.CommunicationChannel))
        self.assertTrue(inspect.isclass(AlphaTwirl.Combine))
        self.assertTrue(inspect.isclass(AlphaTwirl.CombineIntoList))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.Counter))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.CounterFactory))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.Counts))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.GenericKeyComposer))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.GenericKeyComposerB))
        self.assertTrue(inspect.isclass(AlphaTwirl.Counter.NextKeyComposer))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.Collector))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventLoop))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventLoopProgressReportWriter))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventLoopRunner))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventReaderBundle))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventReaderCollectorAssociator))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventReaderCollectorAssociatorComposite))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.EventReaderComposite))
        self.assertTrue(inspect.isclass(AlphaTwirl.EventReader.MPEventLoopRunner))
        self.assertTrue(inspect.isclass(AlphaTwirl.Events.Branch))
        self.assertTrue(inspect.isclass(AlphaTwirl.Events.BranchAddressManager))
        self.assertTrue(inspect.isclass(AlphaTwirl.Events.Events))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.Analyzer))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.Component))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.ComponentLoop))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.ComponentReaderComposite))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.HeppyResult))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.ReadComponentConfig))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.ReadCounter))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.ReadVersionInfo))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.TblCounter))
        self.assertTrue(inspect.isclass(AlphaTwirl.HeppyResult.TblXsec))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.ProgressBar))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.ProgressMonitor))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.ProgressReport))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.ProgressReporter))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.NullProgressMonitor))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.MPProgressMonitor))
        self.assertTrue(inspect.isclass(AlphaTwirl.ProgressBar.BProgressMonitor))
        self.assertTrue(inspect.isclass(AlphaTwirl.WriteListToFile))

##________________________________._________________________________||
{'fraction_non_alphanumeric': 0.09536784741144415, 'fraction_numerical': 0.0005838847800700662, 'mean_word_length': 5.236043689320389, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '96301', 'n_tokens_mistral': 2994, 'n_tokens_neox': 3050, 'n_words': 199}