<commit_before>import collections
import time
import numpy
import scipy.optimize
import scipy.stats
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import BoundaryNorm

from threeML.io.rich_display import display
import numpy as np
import pandas as pd
import uncertainties


from threeML.minimizer import minimization
from threeML.exceptions import custom_exceptions
from threeML.io.table import Table, NumericMatrix
from threeML.parallel.parallel_client import ParallelClient
from threeML.io.progress_bar import ProgressBar
from threeML.config.config import threeML_config
from threeML.exceptions.custom_exceptions import custom_warnings, FitFailed
from threeML.utils.uncertainties_regexpr import get_uncertainty_tokens


from astromodels import ModelAssertionViolation

class ReducingNumberOfThreads(Warning):
    pass


class ReducingNumberOfSteps(Warning):
    pass


class NotANumberInLikelihood(Warning):
    pass


class JointLikelihood(object):
    def __init__(self, likelihood_model, data_list, verbose=False):
        """
        Implement a joint likelihood analysis.

        :param likelihood_model: the model for the likelihood analysis
        :param data_list: the list of data sets (plugin instances) to be used in this analysis
        :param verbose: (True or False) print every step in the -log likelihood minimization
        :return:
        """

        # Process optional keyword parameters
        self.verbose = verbose

        self._likelihood_model = likelihood_model

        self._data_list = data_list

        for dataset in self._data_list.values():

            dataset.set_model(self._likelihood_model)

        # This is to keep track of the number of calls to the likelihood
        # function
        self.ncalls = 0

        # Pre-defined minimizer is Minuit<commit_msg>added private variable to indicate the type of analysis<commit_after>import collections
import time
import numpy
import scipy.optimize
import scipy.stats
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import BoundaryNorm

from threeML.io.rich_display import display
import numpy as np
import pandas as pd
import uncertainties


from threeML.minimizer import minimization
from threeML.exceptions import custom_exceptions
from threeML.io.table import Table, NumericMatrix
from threeML.parallel.parallel_client import ParallelClient
from threeML.io.progress_bar import ProgressBar
from threeML.config.config import threeML_config
from threeML.exceptions.custom_exceptions import custom_warnings, FitFailed
from threeML.utils.uncertainties_regexpr import get_uncertainty_tokens


from astromodels import ModelAssertionViolation

class ReducingNumberOfThreads(Warning):
    pass


class ReducingNumberOfSteps(Warning):
    pass


class NotANumberInLikelihood(Warning):
    pass


class JointLikelihood(object):
    def __init__(self, likelihood_model, data_list, verbose=False):
        """
        Implement a joint likelihood analysis.

        :param likelihood_model: the model for the likelihood analysis
        :param data_list: the list of data sets (plugin instances) to be used in this analysis
        :param verbose: (True or False) print every step in the -log likelihood minimization
        :return:
        """

        self._analysis_type = "mle"

        # Process optional keyword parameters
        self.verbose = verbose

        self._likelihood_model = likelihood_model

        self._data_list = data_list

        for dataset in self._data_list.values():

            dataset.set_model(self._likelihood_model)

        # This is to keep track of the number of calls to the likelihood
        # function
        self.ncalls = 0

        # Pre-defined minimizer is Minuit
{'fraction_non_alphanumeric': 0.047227381268240914, 'fraction_numerical': 0.0005306447333510214, 'mean_word_length': 3.7721518987341773, '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': '1674411', 'n_tokens_mistral': 1028, 'n_tokens_neox': 976, 'n_words': 343}