{
    "file_diffs": [
        {
            "old_file_content": "import calendar\nimport re\nimport time\nfrom typing import NamedTuple, List, Union, Callable\nimport datetime\nfrom itertools import count\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom Orange.data import DiscreteVariable, Domain\nfrom Orange.data.sql.table import SqlTable\nfrom Orange.statistics import distribution, contingency, util as ut\nfrom Orange.statistics.basic_stats import BasicStats\nfrom Orange.util import Reprable, utc_from_timestamp\nfrom .transformation import Transformation\nfrom . import _discretize\n\n__all__ = [\"EqualFreq\", \"EqualWidth\", \"EntropyMDL\", \"DomainDiscretizer\",\n           \"decimal_binnings\", \"time_binnings\", \"short_time_units\",\n           \"BinDefinition\"]\n\n\nclass Discretizer(Transformation):\n    \"\"\"Value transformer that returns an index of the bin for the given value.\n    \"\"\"\n    def __init__(self, variable, points):\n        super().__init__(variable)\n        self.points = points\n\n    @staticmethod\n    def digitize(x, bins):\n        if sp.issparse(x):\n            if len(bins):\n                x.data = np.digitize(x.data, bins)\n            else:\n                x = sp.csr_matrix(x.shape)\n            return x\n        else:\n            return np.digitize(x, bins) if len(bins) else [0]*len(x)\n\n    def transform(self, c):\n        if sp.issparse(c):\n            return self.digitize(c, self.points)\n        elif c.size:\n            return np.where(np.isnan(c), np.NaN, self.digitize(c, self.points))\n        else:\n            return np.array([], dtype=int)\n\n    @staticmethod\n    def _fmt_interval(low, high, formatter):\n        assert low is not None or high is not None\n        assert low is None or high is None or low < high\n        if low is None or np.isinf(low):\n            return f\"< {formatter(high)}\"\n        if high is None or np.isinf(high):\n            return f\"≥ {formatter(low)}\"\n        return f\"{formatter(low)} - {formatter(high)}\"\n\n    @classmethod\n    def create_discretized_var(cls, var, points):\n        def fmt(val):\n            sval = var.str_val(val)\n            # For decimal numbers, remove trailing 0's and . if no decimals left\n            if re.match(r\"^\\d+\\.\\d+\", sval):\n                return sval.rstrip(\"0\").rstrip(\".\")\n            return sval\n\n        lpoints = list(points)\n        if lpoints:\n            values = [\n                cls._fmt_interval(low, high, fmt)\n                for low, high in zip([-np.inf] + lpoints, lpoints + [np.inf])]\n            to_sql = BinSql(var, lpoints)\n        else:\n            values = [\"single_value\"]\n            to_sql = SingleValueSql(values[0])\n\n        dvar = DiscreteVariable(name=var.name, values=values,\n                                compute_value=cls(var, points),\n                                sparse=var.sparse)\n        dvar.source_variable = var\n        dvar.to_sql = to_sql\n        return dvar\n\n    def __eq__(self, other):\n        return super().__eq__(other) and self.points == other.points\n\n    def __hash__(self):\n        return hash((type(self), self.variable, tuple(self.points)))\n\n\nclass BinSql:\n    def __init__(self, var, points):\n        self.var = var\n        self.points = points\n\n    def __call__(self):\n        return 'width_bucket(%s, ARRAY%s::double precision[])' % (\n            self.var.to_sql(), str(self.points))\n\n\nclass SingleValueSql:\n    def __init__(self, value):\n        self.value = value\n\n    def __call__(self):\n        return \"'%s'\" % self.value\n\n\nclass Discretization(Reprable):\n    \"\"\"Abstract base class for discretization classes.\"\"\"\n    def __call__(self, data, variable):\n        \"\"\"\n        Compute discretization of the given variable on the given data.\n        Return a new variable with the appropriate domain\n        (:obj:`Orange.data.DiscreteVariable.values`) and transformer\n        (:obj:`Orange.data.Variable.compute_value`).\n        \"\"\"\n        raise NotImplementedError(\n            \"Subclasses of 'Discretization' need to implement \"\n            \"the call operator\")\n\n\nclass EqualFreq(Discretization):\n    \"\"\"Discretization into bins with approximately equal number of data\n    instances.\n\n    .. attribute:: n\n\n        Number of bins (default: 4). The actual number may be lower if the\n        variable has less than n distinct values.\n    \"\"\"\n    def __init__(self, n=4):\n        self.n = n\n\n    # noinspection PyProtectedMember\n    def __call__(self, data, attribute):\n        if type(data) == SqlTable:\n            att = attribute.to_sql()\n            quantiles = [(i + 1) / self.n for i in range(self.n - 1)]\n            query = data._sql_query(\n                ['quantile(%s, ARRAY%s)' % (att, str(quantiles))],\n                use_time_sample=1000)\n            with data._execute_sql_query(query) as cur:\n                points = sorted(set(cur.fetchone()[0]))\n        else:\n            d = distribution.get_distribution(data, attribute)\n            points = _discretize.split_eq_freq(d, self.n)\n            # np.unique handles cases in which differences are below precision\n            points = list(np.unique(points))\n        return Discretizer.create_discretized_var(\n            data.domain[attribute], points)\n\nclass EqualWidth(Discretization):\n    \"\"\"Discretization into a fixed number of bins with equal widths.\n\n    .. attribute:: n\n\n        Number of bins (default: 4).\n    \"\"\"\n    def __init__(self, n=4):\n        self.n = n\n\n    # noinspection PyProtectedMember\n    def __call__(self, data, attribute, fixed=None):\n        if fixed:\n            min, max = fixed[attribute.name]\n            points = self._split_eq_width(min, max)\n        else:\n            if type(data) == SqlTable:\n                stats = BasicStats(data, attribute)\n                points = self._split_eq_width(stats.min, stats.max)\n            else:\n                values = data[:, attribute]\n                values = values.X if values.X.size else values.Y\n                if values.size:\n                    min, max = ut.nanmin(values), ut.nanmax(values)\n                    points = self._split_eq_width(min, max)\n                else:\n                    points = []\n        return Discretizer.create_discretized_var(\n            data.domain[attribute], points)\n\n    def _split_eq_width(self, min, max):\n        if np.isnan(min) or np.isnan(max) or min == max:\n            return []\n        dif = (max - min) / self.n\n        return [min + (i + 1) * dif for i in range(self.n - 1)]\n\n\nclass BinDefinition(NamedTuple):\n    thresholds: np.ndarray  # thresholds, including the top\n    labels: List[str]  # friendly-formatted thresholds\n    short_labels: List[str]  # shorter labels (e.g. simplified dates)\n    width: Union[float, None]  # widths, if uniform; otherwise None\n    width_label: str  # friendly-formatted width (e.g. '50' or '2 weeks')\n\n\n# NamedTupleMeta doesn't allow to define __new__ so we need a subclass\n# Name of the class has to be the same to match the namedtuple name\n# pylint: disable=function-redefined\nclass BinDefinition(BinDefinition):\n    def __new__(cls, thresholds, labels=\"%g\",\n                short_labels=None, width=None, width_label=\"\"):\n\n        def get_labels(fmt, default=None):\n            if fmt is None:\n                return default\n            if isinstance(fmt, str):\n                return [fmt % x for x in thresholds]\n            elif isinstance(fmt, Callable):\n                return [fmt(x) for x in thresholds]\n            else:\n                return fmt\n\n        labels = get_labels(labels)\n        short_labels = get_labels(short_labels, labels)\n        if not width_label and width is not None:\n            width_label = f\"{width:g}\"\n        return super().__new__(\n            cls, thresholds, labels, short_labels, width, width_label)\n\n    @property\n    def start(self) -> float:\n        return self.thresholds[0]\n\n    @property\n    def nbins(self) -> int:\n        return len(self.thresholds) - 1\n\n\ndef decimal_binnings(\n        data, *, min_width=0, min_bins=2, max_bins=50,\n        min_unique=5, add_unique=0,\n        factors=(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20),\n        label_fmt=\"%g\"):\n    \"\"\"\n    Find a set of nice splits of data into bins\n\n    The function first computes the scaling factor that is, the power of 10\n    that brings the interval of values within [0, 1]. For instances, if the\n    numbers come from interaval 10004001 and 10007005, the width of the\n    interval is 3004, so the scaling factor is 1000.\n\n    The function next considers bin widths that are products of scaling and\n    different factors from 20 to 0.01 that make sense in decimal scale\n    (see default value for argument `factors`). For each width, it rounds the\n    minimal value down to this width and the maximal value up, and it computes\n    the number of bins of that width that fit between these two values.\n    If the number of bins is between `min_bins` and `max_bins`, and the width\n    is at least `min_width`, this is a valid interval.\n\n    If the data has no more than `min_unique` unique values, the function will\n    add a set of bins that put each value into its own bin.\n\n    If the data has no more than `add_unique` values, that last bins will put\n    each value into its own bin.\n\n    Args:\n        data (np.ndarray):\n            vector of data points; values may repeat, and nans and infs are\n            filtered out.\n        min_width (float): minimal bin width\n        min_bins (int): minimal number of bins\n        max_bins (int):\n            maximal number of bins; the number of bins will never exceed the\n            number of unique values\n        min_unique (int):\n            if the number of unique values are less or equal to `min_unique`,\n            the function returns a single binning that matches that values in\n            the data\n        add_unique (int):\n            similar to `min_unique` except that such bins are added to the list;\n            set to 0 to disable\n        factors (list of float):\n            The factors with which the scaling is multiplied. Default is\n            `(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20)`,\n            so if scaling is 1000, considered bin widths are 20000, 10000,\n            5000, 2000, 1000, 500, 250, 200, 100, 50, 25, 20 and 10.\n        label_fmt (str or Callable):\n            A format string (default: \"%g\") used for threshold labels,\n            or a function for formatting thresholds (e.g. var.str_val)\n\n    Returns:\n        bin_boundaries (list of np.ndarray): a list of bin boundaries,\n            including the top boundary of the last interval, hence the list\n            size equals the number bins + 1. These array match the `bin`\n            argument of `numpy.histogram`.\n\n            This is returned if `return_defs` is left `True`.\n\n        bin_definition (list of BinDefinition):\n            `BinDefinition` is a named tuple containing the beginning of the\n            first bin (`start`), number of bins (`nbins`) and their widths\n            (`width`). The last value can also be a `nd.array` with `nbins + 1`\n            elements, which describes bins of unequal width and is used for\n            binnings that match the unique values in the data (see `min_unique`\n            and `add_unique`).\n\n            This is returned if `return_defs` is `False`.\n    \"\"\"\n    bins = []\n\n    mn, mx, unique = _min_max_unique(data)\n    if len(unique) <= max(min_unique, add_unique):\n        bins.append(BinDefinition(_unique_thresholds(unique), label_fmt))\n        if len(unique) <= min_unique:\n            return bins\n\n    diff = mx - mn\n    f10 = 10 ** -np.floor(np.log10(diff))\n    max_bins = min(max_bins, len(unique))\n    for f in factors:\n        width = f / f10\n        if width < min_width:\n            continue\n        mn_ = np.floor(mn / width) * width\n        mx_ = np.ceil(mx / width) * width\n        nbins = np.round((mx_ - mn_) / width)\n        if min_bins <= nbins <= max_bins \\\n                and (not bins or bins[-1].nbins != nbins):\n            bin_def = BinDefinition(mn_ + width * np.arange(nbins + 1),\n                                    label_fmt, None, width)\n            bins.append(bin_def)\n    return bins\n\n\ndef time_binnings(data, *, min_bins=2, max_bins=50, min_unique=5, add_unique=0):\n    \"\"\"\n    Find a set of nice splits of time variable data into bins\n\n    The function considers bin widths of\n\n    - 1, 5, 10, 15, 30 seconds.\n    - 1, 5, 10, 15, 30 minutes,\n    - 1, 2, 3, 6, 12 hours,\n    - 1 day,\n    - 1, 2 weeks,\n    - 1, 2, 3, 6 months,\n    - 1, 2, 5, 10, 25, 50, 100 years,\n\n    and returns those that yield between `min_bins` and `max_bins` intervals.\n\n    Args:\n        data (np.ndarray):\n            vector of data points; values may repeat, and nans and infs are\n            filtered out.\n        min_bins (int): minimal number of bins\n        max_bins (int):\n            maximal number of bins; the number of bins will never exceed the\n            number of unique values\n\n    Returns:\n        bin_boundaries (list): a list of possible binning.\n            Each element of `bin_boundaries` is a tuple consisting of a label\n            describing the bin size (e.g. `2 weeks`) and a list of thresholds.\n            Thresholds are given as pairs\n            (number_of_seconds_since_epoch, label).\n    \"\"\"\n    mn, mx, unique = _min_max_unique(data)\n    mn = utc_from_timestamp(mn).timetuple()\n    mx = utc_from_timestamp(mx).timetuple()\n    bins = []\n    if len(unique) <= max(min_unique, add_unique):\n        bins.append(_unique_time_bins(unique))\n    if len(unique) > min_unique:\n        bins += _time_binnings(mn, mx, min_bins + 1, max_bins + 1)\n    return bins\n\n\ndef _time_binnings(mn, mx, min_pts, max_pts):\n    bins = []\n    for place, step, fmt, unit in (\n            [(5, x, \"%H:%M:%S\", \"second\") for x in (1, 5, 10, 15, 30)] +\n            [(4, x, \"%b %d %H:%M\", \"minute\") for x in (1, 5, 10, 15, 30)] +\n            [(3, x, \"%y %b %d %H:%M\", \"hour\") for x in (1, 2, 3, 6, 12)] +\n            [(2, 1, \"%y %b %d\", \"day\")] +\n            [(2, x, \"%y %b %d\", \"week\") for x in (7, 14)] +\n            [(1, x, \"%y %b\", \"month\") for x in (1, 2, 3, 6)] +\n            [(0, x, \"%Y\", \"year\") for x in (1, 2, 5, 10, 25, 50, 100)]):\n        times = _time_range(mn, mx, place, step, min_pts, max_pts)\n        if not times:\n            continue\n        times = [time.struct_time(t + (0, 0, 0)) for t in times]\n        thresholds = [calendar.timegm(t) for t in times]\n        labels = [time.strftime(fmt, t) for t in times]\n        short_labels = _simplified_labels(labels)\n        if place == 2 and step >= 7:\n            unit_label = f\"{step // 7} week{'s' * (step > 7)}\"\n        else:\n            unit_label = f\"{step} {unit}{'s' * (step > 1)}\"\n        new_bins = BinDefinition(\n            thresholds, labels, short_labels, None, unit_label)\n        if not bins or new_bins.nbins != bins[-1].nbins:\n            bins.append(new_bins)\n    return bins\n\n\n# datetime + deltatime is not very useful here because deltatime is\n# given a number of days, not years or months, so it doesn't allow\n# for specifying a step of 1 month\ndef _time_range(start, end, place, step, min_pts, max_pts,\n                _zeros=(0, 1, 1, 0, 0, 0)):\n    if place == 2 and step % 7 == 0:\n        startd = datetime.date(*start[:3])\n        startd -= datetime.timedelta(days=-startd.weekday())\n        start = [startd.year, startd.month, startd.day, 0, 0, 0]\n    else:\n        start = list(\n            start[:place]\n            + ((start[place] - _zeros[place]) // step * step + _zeros[place], )\n            + _zeros[place + 1:])\n    end = list(end[:place + 1] + _zeros[place + 1:])\n    s = [tuple(start)]\n    for _ in range(max_pts - 1):\n        start[place] += step\n        if place >= 3:  # hours, minutes, seconds\n            for pos, maxval in enumerate((60, 60, 24), start=1):\n                if start[-pos] >= maxval:\n                    start[-pos - 1] += 1\n                    start[-pos] %= maxval\n        if place >= 2:\n            md = _month_days(*start[:2])\n            if start[2] > md:\n                start[1] += 1\n                start[2] %= md\n        if start[1] > 12:\n            start[0] += 1\n            start[1] %= 12\n        s.append(tuple(start))\n        if start > end:\n            return s if len(s) >= min_pts else None\n    return None\n\n\ndef _month_days(year, month,\n                _md=(None, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)):\n    return _md[month] + (\n        month == 2 and (year % 400 == 0 or year % 4 == 0 and year % 100 != 0))\n\n\ndef _simplified_labels(labels):\n    labels = labels[:]\n    to_remove = \"42\"\n    while True:\n        firsts = {f for f, *_ in (lab.split() for lab in labels)}\n        if len(firsts) > 1:\n            break\n        to_remove = firsts.pop()\n        flen = len(to_remove)\n        if any(len(lab) == flen for lab in labels):\n            break\n        labels = [lab[flen+1:] for lab in labels]\n    for i in range(len(labels) - 1, 0, -1):\n        for k, c, d in zip(count(), labels[i].split(), labels[i - 1].split()):\n            if c != d:\n                labels[i] = \" \".join(labels[i].split()[k:])\n                break\n    # If the last thing removed were month names and the labels continues with\n    # hours, keep month name in the first label; \"08 12:29\" looks awkward.\n    if not to_remove[0].isdigit() and \":\" in labels[0]:\n        labels[0] = f\"{to_remove} {labels[0]}\"\n    return labels\n\n\ndef _unique_time_bins(unique):\n    times = [utc_from_timestamp(x).timetuple() for x in unique]\n    fmt = f'%y %b %d'\n    fmt += \" %H:%M\" * (len({t[2:] for t in times}) > 1)\n    fmt += \":%S\" * bool(np.all(unique % 60 == 0))\n    labels = [time.strftime(fmt, x) for x in times]\n    short_labels = _simplified_labels(labels)\n    return BinDefinition(_unique_thresholds(unique), labels, short_labels)\n\n\ndef _unique_thresholds(unique):\n    if len(unique) >= 2:\n        # make the last bin the same width as the one before\n        last_boundary = 2 * unique[-1] - unique[-2]\n    else:\n        last_boundary = unique[0] + 1\n    return np.hstack((unique, [last_boundary]))\n\n\ndef _min_max_unique(data):\n    unique = np.unique(data)\n    unique = unique[np.isfinite(unique)]\n    if not unique.size:\n        raise ValueError(\"no valid (non-nan) data\")\n    return unique[0], unique[-1], unique\n\n\nshort_time_units = dict(seconds=\"sec\", minutes=\"min\", hours=\"hrs\",\n                        weeks=\"wks\", months=\"mon\", years=\"yrs\",\n                        second=\"sec\", minute=\"min\", month=\"mon\")\n\n\n# noinspection PyPep8Naming\nclass EntropyMDL(Discretization):\n    \"\"\"\n    Discretization into bins inferred by recursively splitting the values to\n    minimize the class-entropy. The procedure stops when further splits would\n    decrease the entropy for less than the corresponding increase of minimal\n    description length (MDL). [FayyadIrani93].\n\n    If there are no suitable cut-off points, the procedure returns a single bin,\n    which means that the new feature is constant and can be removed.\n\n    .. attribute:: force\n\n        Induce at least one cut-off point, even when its information\n        gain is lower than MDL (default: False).\n\n    \"\"\"\n    def __init__(self, force=False):\n        self.force = force\n\n    def __call__(self, data, attribute):\n        cont = contingency.get_contingency(data, attribute)\n        values, I = cont.values, cont.counts.T\n        cut_ind = np.array(self._entropy_discretize_sorted(I, self.force))\n        if len(cut_ind) > 0:\n            # \"the midpoint between each successive pair of examples\" (FI p.1)\n            points = (values[cut_ind] + values[cut_ind - 1]) / 2.\n        else:\n            points = []\n        return Discretizer.create_discretized_var(\n            data.domain[attribute], points)\n\n    @classmethod\n    def _normalize(cls, X, axis=None, out=None):\n        \"\"\"\n        Normalize `X` array so it sums to 1.0 over the `axis`.\n\n        Parameters\n        ----------\n        X : array\n            Array to normalize.\n        axis : optional int\n            Axis over which the resulting array sums to 1.\n        out : optional array\n            Output array of the same shape as X.\n        \"\"\"\n        X = np.asarray(X, dtype=float)\n        scale = np.sum(X, axis=axis, keepdims=True)\n        if out is None:\n            return X / scale\n        else:\n            if out is not X:\n                assert out.shape == X.shape\n                out[:] = X\n            out /= scale\n            return out\n\n    @classmethod\n    def _entropy_normalized(cls, D, axis=None):\n        \"\"\"\n        Compute the entropy of distribution array `D`.\n\n        `D` must be a distribution (i.e. sum to 1.0 over `axis`)\n\n        Parameters\n        ----------\n        D : array\n            Distribution.\n        axis : optional int\n            Axis of `D` along which to compute the entropy.\n\n        \"\"\"\n        # req: (np.sum(D, axis=axis) >= 0).all()\n        # req: (np.sum(D, axis=axis) <= 1).all()\n        # req: np.all(np.abs(np.sum(D, axis=axis) - 1) < 1e-9)\n\n        D = np.asarray(D)\n        Dc = np.clip(D, np.finfo(D.dtype).eps, 1.0)\n        return - np.sum(D * np.log2(Dc), axis=axis)\n\n    @classmethod\n    def _entropy(cls, D, axis=None):\n        \"\"\"\n        Compute the entropy of distribution `D`.\n\n        Parameters\n        ----------\n        D : array\n            Distribution.\n        axis : optional int\n            Axis of `D` along which to compute the entropy.\n\n        \"\"\"\n        D = cls._normalize(D, axis=axis)\n        return cls._entropy_normalized(D, axis=axis)\n\n    @classmethod\n    def _entropy1(cls, D):\n        \"\"\"\n        Compute the entropy of distributions in `D`\n        (one per each row).\n        \"\"\"\n        D = cls._normalize(D)\n        return _discretize.entropy_normalized1(D)\n\n    @classmethod\n    def _entropy2(cls, D):\n        \"\"\"\n        Compute the entropy of distributions in `D`\n        (one per each row).\n        \"\"\"\n        D = cls._normalize(D, axis=1)\n        return _discretize.entropy_normalized2(D)\n\n    @classmethod\n    def _entropy_cuts_sorted(cls, CS):\n        \"\"\"\n        Return the class information entropy induced by partitioning\n        the `CS` distribution at all N-1 candidate cut points.\n\n        Parameters\n        ----------\n        CS : (N, K) array of class distributions.\n        \"\"\"\n        CS = np.asarray(CS)\n        # |--|-------|--------|\n        #  S1    ^       S2\n        # S1 contains all points which are <= to cut point\n        # Cumulative distributions for S1 and S2 (left right set)\n        # i.e. a cut at index i separates the CS into S1Dist[i] and S2Dist[i]\n        S1Dist = np.cumsum(CS, axis=0)[:-1]\n        S2Dist = np.cumsum(CS[::-1], axis=0)[-2::-1]\n\n        # Entropy of S1[i] and S2[i] sets\n        ES1 = cls._entropy2(S1Dist)\n        ES2 = cls._entropy2(S2Dist)\n\n        # Number of cases in S1[i] and S2[i] sets\n        S1_count = np.sum(S1Dist, axis=1)\n        S2_count = np.sum(S2Dist, axis=1)\n\n        # Number of all cases\n        S_count = np.sum(CS)\n\n        ES1w = ES1 * S1_count / S_count\n        ES2w = ES2 * S2_count / S_count\n\n        # E(A, T; S) Class information entropy of the partition S\n        E = ES1w + ES2w\n\n        return E, ES1, ES2\n\n    @classmethod\n    def _entropy_discretize_sorted(cls, C, force=False):\n        \"\"\"\n        Entropy discretization on a sorted C.\n\n        :param C: (N, K) array of class distributions.\n\n        \"\"\"\n        E, ES1, ES2 = cls._entropy_cuts_sorted(C)\n        # TODO: Also get the left right distribution counts from\n        # entropy_cuts_sorted,\n\n        # Note the + 1\n        if len(E) == 0:\n            return []\n        cut_index = np.argmin(E) + 1\n\n        # Distribution of classed in S1, S2 and S\n        S1_c = np.sum(C[:cut_index], axis=0)\n        S2_c = np.sum(C[cut_index:], axis=0)\n        S_c = S1_c + S2_c\n\n        ES = cls._entropy1(np.sum(C, axis=0))\n        ES1, ES2 = ES1[cut_index - 1], ES2[cut_index - 1]\n\n        # Information gain of the best split\n        Gain = ES - E[cut_index - 1]\n        # Number of different classes in S, S1 and S2\n        k = float(np.sum(S_c > 0))\n        k1 = float(np.sum(S1_c > 0))\n        k2 = float(np.sum(S2_c > 0))\n\n        assert k > 0\n        delta = np.log2(3 ** k - 2) - (k * ES - k1 * ES1 - k2 * ES2)\n        N = float(np.sum(S_c))\n\n        if N > 1 and Gain > np.log2(N - 1) / N + delta / N:\n            # Accept the cut point and recursively split the subsets.\n            left, right = [], []\n            if k1 > 1 and cut_index > 1:\n                left = cls._entropy_discretize_sorted(C[:cut_index, :])\n            if k2 > 1 and cut_index < len(C) - 1:\n                right = cls._entropy_discretize_sorted(C[cut_index:, :])\n            return left + [cut_index] + [i + cut_index for i in right]\n        elif force:\n            return [cut_index]\n        else:\n            return []\n\n\nclass DomainDiscretizer(Reprable):\n    \"\"\"Discretizes all continuous features in the data.\n\n    .. attribute:: method\n\n        Feature discretization method (instance of\n        :obj:`Orange.preprocess.Discretization`). If `None` (default),\n        :class:`Orange.preprocess.EqualFreq` with 4 intervals is\n        used.\n\n    .. attribute:: clean\n\n        If `True`, features discretized into a single interval constant are\n        removed. This is useful for discretization methods that infer the\n        number of intervals from the data, such as\n        :class:`Orange.preprocess.EntropyMDL` (default: `True`).\n\n    .. attribute:: discretize_class\n\n        Determines whether a target is also discretized if it is continuous.\n        (default: `False`)\n    \"\"\"\n    def __init__(self, discretize_class=False, method=None, clean=True,\n                 fixed=None):\n        self.discretize_class = discretize_class\n        self.method = method\n        self.clean = clean\n        self.fixed = fixed\n\n    def __call__(self, data, fixed=None):\n        \"\"\"\n        Compute and return discretized domain.\n\n        :param data: Data to discretize.\n        \"\"\"\n\n        def transform_list(s, fixed=None):\n            new_vars = []\n            for var in s:\n                if var.is_continuous:\n                    if fixed and var.name in fixed.keys():\n                        nv = method(data, var, fixed)\n                    else:\n                        nv = method(data, var)\n                    if not self.clean or len(nv.values) > 1:\n                        new_vars.append(nv)\n                else:\n                    new_vars.append(var)\n            return new_vars\n        if self.method is None:\n            method = EqualFreq(n=4)\n        else:\n            method = self.method\n        domain = data.domain\n        new_attrs = transform_list(domain.attributes, fixed or self.fixed)\n        if self.discretize_class:\n            new_classes = transform_list(domain.class_vars)\n        else:\n            new_classes = domain.class_vars\n        return Domain(new_attrs, new_classes)\n",
            "new_file_content": "import calendar\nimport re\nimport time\nfrom typing import NamedTuple, List, Union, Callable\nimport datetime\nfrom itertools import count\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom Orange.data import DiscreteVariable, Domain\nfrom Orange.data.sql.table import SqlTable\nfrom Orange.statistics import distribution, contingency, util as ut\nfrom Orange.statistics.basic_stats import BasicStats\nfrom Orange.util import Reprable, utc_from_timestamp\nfrom .transformation import Transformation\nfrom . import _discretize\n\n__all__ = [\"EqualFreq\", \"EqualWidth\", \"EntropyMDL\", \"DomainDiscretizer\",\n           \"decimal_binnings\", \"time_binnings\", \"short_time_units\",\n           \"BinDefinition\"]\n\n\nclass Discretizer(Transformation):\n    \"\"\"Value transformer that returns an index of the bin for the given value.\n    \"\"\"\n    def __init__(self, variable, points):\n        super().__init__(variable)\n        self.points = points\n\n    @staticmethod\n    def digitize(x, bins):\n        if sp.issparse(x):\n            if len(bins):\n                x.data = np.digitize(x.data, bins)\n            else:\n                x = sp.csr_matrix(x.shape)\n            return x\n        else:\n            return np.digitize(x, bins) if len(bins) else [0]*len(x)\n\n    def transform(self, c):\n        if sp.issparse(c):\n            return self.digitize(c, self.points)\n        elif c.size:\n            return np.where(np.isnan(c), np.NaN, self.digitize(c, self.points))\n        else:\n            return np.array([], dtype=int)\n\n    @staticmethod\n    def _fmt_interval(low, high, formatter):\n        assert low is not None or high is not None\n        assert low is None or high is None or low < high\n        if low is None or np.isinf(low):\n            return f\"< {formatter(high)}\"\n        if high is None or np.isinf(high):\n            return f\"≥ {formatter(low)}\"\n        return f\"{formatter(low)} - {formatter(high)}\"\n\n    @classmethod\n    def create_discretized_var(cls, var, points):\n        def fmt(val):\n            sval = var.str_val(val)\n            # For decimal numbers, remove trailing 0's and . if no decimals left\n            if re.match(r\"^\\d+\\.\\d+\", sval):\n                return sval.rstrip(\"0\").rstrip(\".\")\n            return sval\n\n        lpoints = list(points)\n        if lpoints:\n            values = [\n                cls._fmt_interval(low, high, fmt)\n                for low, high in zip([-np.inf] + lpoints, lpoints + [np.inf])]\n            to_sql = BinSql(var, lpoints)\n        else:\n            values = [\"single_value\"]\n            to_sql = SingleValueSql(values[0])\n\n        dvar = DiscreteVariable(name=var.name, values=values,\n                                compute_value=cls(var, points),\n                                sparse=var.sparse)\n        dvar.source_variable = var\n        dvar.to_sql = to_sql\n        return dvar\n\n    def __eq__(self, other):\n        return super().__eq__(other) and self.points == other.points\n\n    def __hash__(self):\n        return hash((type(self), self.variable, tuple(self.points)))\n\n\nclass BinSql:\n    def __init__(self, var, points):\n        self.var = var\n        self.points = points\n\n    def __call__(self):\n        return 'width_bucket(%s, ARRAY%s::double precision[])' % (\n            self.var.to_sql(), str(self.points))\n\n\nclass SingleValueSql:\n    def __init__(self, value):\n        self.value = value\n\n    def __call__(self):\n        return \"'%s'\" % self.value\n\n\nclass Discretization(Reprable):\n    \"\"\"Abstract base class for discretization classes.\"\"\"\n    def __call__(self, data, variable):\n        \"\"\"\n        Compute discretization of the given variable on the given data.\n        Return a new variable with the appropriate domain\n        (:obj:`Orange.data.DiscreteVariable.values`) and transformer\n        (:obj:`Orange.data.Variable.compute_value`).\n        \"\"\"\n        raise NotImplementedError(\n            \"Subclasses of 'Discretization' need to implement \"\n            \"the call operator\")\n\n\nclass EqualFreq(Discretization):\n    \"\"\"Discretization into bins with approximately equal number of data\n    instances.\n\n    .. attribute:: n\n\n        Number of bins (default: 4). The actual number may be lower if the\n        variable has less than n distinct values.\n    \"\"\"\n    def __init__(self, n=4):\n        self.n = n\n\n    # noinspection PyProtectedMember\n    def __call__(self, data, attribute):\n        if type(data) == SqlTable:\n            att = attribute.to_sql()\n            quantiles = [(i + 1) / self.n for i in range(self.n - 1)]\n            query = data._sql_query(\n                ['quantile(%s, ARRAY%s)' % (att, str(quantiles))],\n                use_time_sample=1000)\n            with data._execute_sql_query(query) as cur:\n                points = sorted(set(cur.fetchone()[0]))\n        else:\n            d = distribution.get_distribution(data, attribute)\n            points = _discretize.split_eq_freq(d, self.n)\n            # np.unique handles cases in which differences are below precision\n            points = list(np.unique(points))\n        return Discretizer.create_discretized_var(\n            data.domain[attribute], points)\n\nclass EqualWidth(Discretization):\n    \"\"\"Discretization into a fixed number of bins with equal widths.\n\n    .. attribute:: n\n\n        Number of bins (default: 4).\n    \"\"\"\n    def __init__(self, n=4):\n        self.n = n\n\n    # noinspection PyProtectedMember\n    def __call__(self, data, attribute, fixed=None):\n        if fixed:\n            min, max = fixed[attribute.name]\n            points = self._split_eq_width(min, max)\n        else:\n            if type(data) == SqlTable:\n                stats = BasicStats(data, attribute)\n                points = self._split_eq_width(stats.min, stats.max)\n            else:\n                values = data[:, attribute]\n                values = values.X if values.X.size else values.Y\n                if values.size:\n                    min, max = ut.nanmin(values), ut.nanmax(values)\n                    points = self._split_eq_width(min, max)\n                else:\n                    points = []\n        return Discretizer.create_discretized_var(\n            data.domain[attribute], points)\n\n    def _split_eq_width(self, min, max):\n        if np.isnan(min) or np.isnan(max) or min == max:\n            return []\n        dif = (max - min) / self.n\n        return [min + (i + 1) * dif for i in range(self.n - 1)]\n\n\nclass BinDefinition(NamedTuple):\n    thresholds: np.ndarray  # thresholds, including the top\n    labels: List[str]  # friendly-formatted thresholds\n    short_labels: List[str]  # shorter labels (e.g. simplified dates)\n    width: Union[float, None]  # widths, if uniform; otherwise None\n    width_label: str  # friendly-formatted width (e.g. '50' or '2 weeks')\n\n\n# NamedTupleMeta doesn't allow to define __new__ so we need a subclass\n# Name of the class has to be the same to match the namedtuple name\n# pylint: disable=function-redefined\nclass BinDefinition(BinDefinition):\n    def __new__(cls, thresholds, labels=\"%g\",\n                short_labels=None, width=None, width_label=\"\"):\n\n        def get_labels(fmt, default=None):\n            if fmt is None:\n                return default\n            if isinstance(fmt, str):\n                return [fmt % x for x in thresholds]\n            elif isinstance(fmt, Callable):\n                return [fmt(x) for x in thresholds]\n            else:\n                return fmt\n\n        labels = get_labels(labels)\n        short_labels = get_labels(short_labels, labels)\n        if not width_label and width is not None:\n            width_label = f\"{width:g}\"\n        return super().__new__(\n            cls, thresholds, labels, short_labels, width, width_label)\n\n    @property\n    def start(self) -> float:\n        return self.thresholds[0]\n\n    @property\n    def nbins(self) -> int:\n        return len(self.thresholds) - 1\n\n\ndef decimal_binnings(\n        data, *, min_width=0, min_bins=2, max_bins=50,\n        min_unique=5, add_unique=0,\n        factors=(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20),\n        label_fmt=\"%g\"):\n    \"\"\"\n    Find a set of nice splits of data into bins\n\n    The function first computes the scaling factor that is, the power of 10\n    that brings the interval of values within [0, 1]. For instances, if the\n    numbers come from interaval 10004001 and 10007005, the width of the\n    interval is 3004, so the scaling factor is 1000.\n\n    The function next considers bin widths that are products of scaling and\n    different factors from 20 to 0.01 that make sense in decimal scale\n    (see default value for argument `factors`). For each width, it rounds the\n    minimal value down to this width and the maximal value up, and it computes\n    the number of bins of that width that fit between these two values.\n    If the number of bins is between `min_bins` and `max_bins`, and the width\n    is at least `min_width`, this is a valid interval.\n\n    If the data has no more than `min_unique` unique values, the function will\n    add a set of bins that put each value into its own bin.\n\n    If the data has no more than `add_unique` values, that last bins will put\n    each value into its own bin.\n\n    Args:\n        data (np.ndarray):\n            vector of data points; values may repeat, and nans and infs are\n            filtered out.\n        min_width (float): minimal bin width\n        min_bins (int): minimal number of bins\n        max_bins (int):\n            maximal number of bins; the number of bins will never exceed the\n            number of unique values\n        min_unique (int):\n            if the number of unique values are less or equal to `min_unique`,\n            the function returns a single binning that matches that values in\n            the data\n        add_unique (int):\n            similar to `min_unique` except that such bins are added to the list;\n            set to 0 to disable\n        factors (list of float):\n            The factors with which the scaling is multiplied. Default is\n            `(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20)`,\n            so if scaling is 1000, considered bin widths are 20000, 10000,\n            5000, 2000, 1000, 500, 250, 200, 100, 50, 25, 20 and 10.\n        label_fmt (str or Callable):\n            A format string (default: \"%g\") used for threshold labels,\n            or a function for formatting thresholds (e.g. var.str_val)\n\n    Returns:\n        bin_boundaries (list of np.ndarray): a list of bin boundaries,\n            including the top boundary of the last interval, hence the list\n            size equals the number bins + 1. These array match the `bin`\n            argument of `numpy.histogram`.\n\n            This is returned if `return_defs` is left `True`.\n\n        bin_definition (list of BinDefinition):\n            `BinDefinition` is a named tuple containing the beginning of the\n            first bin (`start`), number of bins (`nbins`) and their widths\n            (`width`). The last value can also be a `nd.array` with `nbins + 1`\n            elements, which describes bins of unequal width and is used for\n            binnings that match the unique values in the data (see `min_unique`\n            and `add_unique`).\n\n            This is returned if `return_defs` is `False`.\n    \"\"\"\n    bins = []\n\n    mn, mx, unique = _min_max_unique(data)\n    if len(unique) <= max(min_unique, add_unique):\n        bins.append(BinDefinition(_unique_thresholds(unique), label_fmt))\n        if len(unique) <= min_unique:\n            return bins\n\n    diff = mx - mn\n    f10 = 10 ** -np.floor(np.log10(diff))\n    max_bins = min(max_bins, len(unique))\n    for f in factors:\n        width = f / f10\n        if width < min_width:\n            continue\n        mn_ = np.floor(mn / width) * width\n        mx_ = np.ceil(mx / width) * width\n        nbins = np.round((mx_ - mn_) / width)\n        if min_bins <= nbins <= max_bins \\\n                and (not bins or bins[-1].nbins != nbins):\n            bins_ = mn_ + width * np.arange(nbins + 1)\n            # to prevent values on the edge of the bin fall in the wrong bin\n            # due to precision error on decimals that are not precise\n            bins_ = np.around(bins_, decimals=np.finfo(bins_.dtype).precision)\n            bin_def = BinDefinition(bins_, label_fmt, None, width)\n            bins.append(bin_def)\n    return bins\n\n\ndef time_binnings(data, *, min_bins=2, max_bins=50, min_unique=5, add_unique=0):\n    \"\"\"\n    Find a set of nice splits of time variable data into bins\n\n    The function considers bin widths of\n\n    - 1, 5, 10, 15, 30 seconds.\n    - 1, 5, 10, 15, 30 minutes,\n    - 1, 2, 3, 6, 12 hours,\n    - 1 day,\n    - 1, 2 weeks,\n    - 1, 2, 3, 6 months,\n    - 1, 2, 5, 10, 25, 50, 100 years,\n\n    and returns those that yield between `min_bins` and `max_bins` intervals.\n\n    Args:\n        data (np.ndarray):\n            vector of data points; values may repeat, and nans and infs are\n            filtered out.\n        min_bins (int): minimal number of bins\n        max_bins (int):\n            maximal number of bins; the number of bins will never exceed the\n            number of unique values\n\n    Returns:\n        bin_boundaries (list): a list of possible binning.\n            Each element of `bin_boundaries` is a tuple consisting of a label\n            describing the bin size (e.g. `2 weeks`) and a list of thresholds.\n            Thresholds are given as pairs\n            (number_of_seconds_since_epoch, label).\n    \"\"\"\n    mn, mx, unique = _min_max_unique(data)\n    mn = utc_from_timestamp(mn).timetuple()\n    mx = utc_from_timestamp(mx).timetuple()\n    bins = []\n    if len(unique) <= max(min_unique, add_unique):\n        bins.append(_unique_time_bins(unique))\n    if len(unique) > min_unique:\n        bins += _time_binnings(mn, mx, min_bins + 1, max_bins + 1)\n    return bins\n\n\ndef _time_binnings(mn, mx, min_pts, max_pts):\n    bins = []\n    for place, step, fmt, unit in (\n            [(5, x, \"%H:%M:%S\", \"second\") for x in (1, 5, 10, 15, 30)] +\n            [(4, x, \"%b %d %H:%M\", \"minute\") for x in (1, 5, 10, 15, 30)] +\n            [(3, x, \"%y %b %d %H:%M\", \"hour\") for x in (1, 2, 3, 6, 12)] +\n            [(2, 1, \"%y %b %d\", \"day\")] +\n            [(2, x, \"%y %b %d\", \"week\") for x in (7, 14)] +\n            [(1, x, \"%y %b\", \"month\") for x in (1, 2, 3, 6)] +\n            [(0, x, \"%Y\", \"year\") for x in (1, 2, 5, 10, 25, 50, 100)]):\n        times = _time_range(mn, mx, place, step, min_pts, max_pts)\n        if not times:\n            continue\n        times = [time.struct_time(t + (0, 0, 0)) for t in times]\n        thresholds = [calendar.timegm(t) for t in times]\n        labels = [time.strftime(fmt, t) for t in times]\n        short_labels = _simplified_labels(labels)\n        if place == 2 and step >= 7:\n            unit_label = f\"{step // 7} week{'s' * (step > 7)}\"\n        else:\n            unit_label = f\"{step} {unit}{'s' * (step > 1)}\"\n        new_bins = BinDefinition(\n            thresholds, labels, short_labels, None, unit_label)\n        if not bins or new_bins.nbins != bins[-1].nbins:\n            bins.append(new_bins)\n    return bins\n\n\n# datetime + deltatime is not very useful here because deltatime is\n# given a number of days, not years or months, so it doesn't allow\n# for specifying a step of 1 month\ndef _time_range(start, end, place, step, min_pts, max_pts,\n                _zeros=(0, 1, 1, 0, 0, 0)):\n    if place == 2 and step % 7 == 0:\n        startd = datetime.date(*start[:3])\n        startd -= datetime.timedelta(days=-startd.weekday())\n        start = [startd.year, startd.month, startd.day, 0, 0, 0]\n    else:\n        start = list(\n            start[:place]\n            + ((start[place] - _zeros[place]) // step * step + _zeros[place], )\n            + _zeros[place + 1:])\n    end = list(end[:place + 1] + _zeros[place + 1:])\n    s = [tuple(start)]\n    for _ in range(max_pts - 1):\n        start[place] += step\n        if place >= 3:  # hours, minutes, seconds\n            for pos, maxval in enumerate((60, 60, 24), start=1):\n                if start[-pos] >= maxval:\n                    start[-pos - 1] += 1\n                    start[-pos] %= maxval\n        if place >= 2:\n            md = _month_days(*start[:2])\n            if start[2] > md:\n                start[1] += 1\n                start[2] %= md\n        if start[1] > 12:\n            start[0] += 1\n            start[1] %= 12\n        s.append(tuple(start))\n        if start > end:\n            return s if len(s) >= min_pts else None\n    return None\n\n\ndef _month_days(year, month,\n                _md=(None, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)):\n    return _md[month] + (\n        month == 2 and (year % 400 == 0 or year % 4 == 0 and year % 100 != 0))\n\n\ndef _simplified_labels(labels):\n    labels = labels[:]\n    to_remove = \"42\"\n    while True:\n        firsts = {f for f, *_ in (lab.split() for lab in labels)}\n        if len(firsts) > 1:\n            break\n        to_remove = firsts.pop()\n        flen = len(to_remove)\n        if any(len(lab) == flen for lab in labels):\n            break\n        labels = [lab[flen+1:] for lab in labels]\n    for i in range(len(labels) - 1, 0, -1):\n        for k, c, d in zip(count(), labels[i].split(), labels[i - 1].split()):\n            if c != d:\n                labels[i] = \" \".join(labels[i].split()[k:])\n                break\n    # If the last thing removed were month names and the labels continues with\n    # hours, keep month name in the first label; \"08 12:29\" looks awkward.\n    if not to_remove[0].isdigit() and \":\" in labels[0]:\n        labels[0] = f\"{to_remove} {labels[0]}\"\n    return labels\n\n\ndef _unique_time_bins(unique):\n    times = [utc_from_timestamp(x).timetuple() for x in unique]\n    fmt = f'%y %b %d'\n    fmt += \" %H:%M\" * (len({t[2:] for t in times}) > 1)\n    fmt += \":%S\" * bool(np.all(unique % 60 == 0))\n    labels = [time.strftime(fmt, x) for x in times]\n    short_labels = _simplified_labels(labels)\n    return BinDefinition(_unique_thresholds(unique), labels, short_labels)\n\n\ndef _unique_thresholds(unique):\n    if len(unique) >= 2:\n        # make the last bin the same width as the one before\n        last_boundary = 2 * unique[-1] - unique[-2]\n    else:\n        last_boundary = unique[0] + 1\n    return np.hstack((unique, [last_boundary]))\n\n\ndef _min_max_unique(data):\n    unique = np.unique(data)\n    unique = unique[np.isfinite(unique)]\n    if not unique.size:\n        raise ValueError(\"no valid (non-nan) data\")\n    return unique[0], unique[-1], unique\n\n\nshort_time_units = dict(seconds=\"sec\", minutes=\"min\", hours=\"hrs\",\n                        weeks=\"wks\", months=\"mon\", years=\"yrs\",\n                        second=\"sec\", minute=\"min\", month=\"mon\")\n\n\n# noinspection PyPep8Naming\nclass EntropyMDL(Discretization):\n    \"\"\"\n    Discretization into bins inferred by recursively splitting the values to\n    minimize the class-entropy. The procedure stops when further splits would\n    decrease the entropy for less than the corresponding increase of minimal\n    description length (MDL). [FayyadIrani93].\n\n    If there are no suitable cut-off points, the procedure returns a single bin,\n    which means that the new feature is constant and can be removed.\n\n    .. attribute:: force\n\n        Induce at least one cut-off point, even when its information\n        gain is lower than MDL (default: False).\n\n    \"\"\"\n    def __init__(self, force=False):\n        self.force = force\n\n    def __call__(self, data, attribute):\n        cont = contingency.get_contingency(data, attribute)\n        values, I = cont.values, cont.counts.T\n        cut_ind = np.array(self._entropy_discretize_sorted(I, self.force))\n        if len(cut_ind) > 0:\n            # \"the midpoint between each successive pair of examples\" (FI p.1)\n            points = (values[cut_ind] + values[cut_ind - 1]) / 2.\n        else:\n            points = []\n        return Discretizer.create_discretized_var(\n            data.domain[attribute], points)\n\n    @classmethod\n    def _normalize(cls, X, axis=None, out=None):\n        \"\"\"\n        Normalize `X` array so it sums to 1.0 over the `axis`.\n\n        Parameters\n        ----------\n        X : array\n            Array to normalize.\n        axis : optional int\n            Axis over which the resulting array sums to 1.\n        out : optional array\n            Output array of the same shape as X.\n        \"\"\"\n        X = np.asarray(X, dtype=float)\n        scale = np.sum(X, axis=axis, keepdims=True)\n        if out is None:\n            return X / scale\n        else:\n            if out is not X:\n                assert out.shape == X.shape\n                out[:] = X\n            out /= scale\n            return out\n\n    @classmethod\n    def _entropy_normalized(cls, D, axis=None):\n        \"\"\"\n        Compute the entropy of distribution array `D`.\n\n        `D` must be a distribution (i.e. sum to 1.0 over `axis`)\n\n        Parameters\n        ----------\n        D : array\n            Distribution.\n        axis : optional int\n            Axis of `D` along which to compute the entropy.\n\n        \"\"\"\n        # req: (np.sum(D, axis=axis) >= 0).all()\n        # req: (np.sum(D, axis=axis) <= 1).all()\n        # req: np.all(np.abs(np.sum(D, axis=axis) - 1) < 1e-9)\n\n        D = np.asarray(D)\n        Dc = np.clip(D, np.finfo(D.dtype).eps, 1.0)\n        return - np.sum(D * np.log2(Dc), axis=axis)\n\n    @classmethod\n    def _entropy(cls, D, axis=None):\n        \"\"\"\n        Compute the entropy of distribution `D`.\n\n        Parameters\n        ----------\n        D : array\n            Distribution.\n        axis : optional int\n            Axis of `D` along which to compute the entropy.\n\n        \"\"\"\n        D = cls._normalize(D, axis=axis)\n        return cls._entropy_normalized(D, axis=axis)\n\n    @classmethod\n    def _entropy1(cls, D):\n        \"\"\"\n        Compute the entropy of distributions in `D`\n        (one per each row).\n        \"\"\"\n        D = cls._normalize(D)\n        return _discretize.entropy_normalized1(D)\n\n    @classmethod\n    def _entropy2(cls, D):\n        \"\"\"\n        Compute the entropy of distributions in `D`\n        (one per each row).\n        \"\"\"\n        D = cls._normalize(D, axis=1)\n        return _discretize.entropy_normalized2(D)\n\n    @classmethod\n    def _entropy_cuts_sorted(cls, CS):\n        \"\"\"\n        Return the class information entropy induced by partitioning\n        the `CS` distribution at all N-1 candidate cut points.\n\n        Parameters\n        ----------\n        CS : (N, K) array of class distributions.\n        \"\"\"\n        CS = np.asarray(CS)\n        # |--|-------|--------|\n        #  S1    ^       S2\n        # S1 contains all points which are <= to cut point\n        # Cumulative distributions for S1 and S2 (left right set)\n        # i.e. a cut at index i separates the CS into S1Dist[i] and S2Dist[i]\n        S1Dist = np.cumsum(CS, axis=0)[:-1]\n        S2Dist = np.cumsum(CS[::-1], axis=0)[-2::-1]\n\n        # Entropy of S1[i] and S2[i] sets\n        ES1 = cls._entropy2(S1Dist)\n        ES2 = cls._entropy2(S2Dist)\n\n        # Number of cases in S1[i] and S2[i] sets\n        S1_count = np.sum(S1Dist, axis=1)\n        S2_count = np.sum(S2Dist, axis=1)\n\n        # Number of all cases\n        S_count = np.sum(CS)\n\n        ES1w = ES1 * S1_count / S_count\n        ES2w = ES2 * S2_count / S_count\n\n        # E(A, T; S) Class information entropy of the partition S\n        E = ES1w + ES2w\n\n        return E, ES1, ES2\n\n    @classmethod\n    def _entropy_discretize_sorted(cls, C, force=False):\n        \"\"\"\n        Entropy discretization on a sorted C.\n\n        :param C: (N, K) array of class distributions.\n\n        \"\"\"\n        E, ES1, ES2 = cls._entropy_cuts_sorted(C)\n        # TODO: Also get the left right distribution counts from\n        # entropy_cuts_sorted,\n\n        # Note the + 1\n        if len(E) == 0:\n            return []\n        cut_index = np.argmin(E) + 1\n\n        # Distribution of classed in S1, S2 and S\n        S1_c = np.sum(C[:cut_index], axis=0)\n        S2_c = np.sum(C[cut_index:], axis=0)\n        S_c = S1_c + S2_c\n\n        ES = cls._entropy1(np.sum(C, axis=0))\n        ES1, ES2 = ES1[cut_index - 1], ES2[cut_index - 1]\n\n        # Information gain of the best split\n        Gain = ES - E[cut_index - 1]\n        # Number of different classes in S, S1 and S2\n        k = float(np.sum(S_c > 0))\n        k1 = float(np.sum(S1_c > 0))\n        k2 = float(np.sum(S2_c > 0))\n\n        assert k > 0\n        delta = np.log2(3 ** k - 2) - (k * ES - k1 * ES1 - k2 * ES2)\n        N = float(np.sum(S_c))\n\n        if N > 1 and Gain > np.log2(N - 1) / N + delta / N:\n            # Accept the cut point and recursively split the subsets.\n            left, right = [], []\n            if k1 > 1 and cut_index > 1:\n                left = cls._entropy_discretize_sorted(C[:cut_index, :])\n            if k2 > 1 and cut_index < len(C) - 1:\n                right = cls._entropy_discretize_sorted(C[cut_index:, :])\n            return left + [cut_index] + [i + cut_index for i in right]\n        elif force:\n            return [cut_index]\n        else:\n            return []\n\n\nclass DomainDiscretizer(Reprable):\n    \"\"\"Discretizes all continuous features in the data.\n\n    .. attribute:: method\n\n        Feature discretization method (instance of\n        :obj:`Orange.preprocess.Discretization`). If `None` (default),\n        :class:`Orange.preprocess.EqualFreq` with 4 intervals is\n        used.\n\n    .. attribute:: clean\n\n        If `True`, features discretized into a single interval constant are\n        removed. This is useful for discretization methods that infer the\n        number of intervals from the data, such as\n        :class:`Orange.preprocess.EntropyMDL` (default: `True`).\n\n    .. attribute:: discretize_class\n\n        Determines whether a target is also discretized if it is continuous.\n        (default: `False`)\n    \"\"\"\n    def __init__(self, discretize_class=False, method=None, clean=True,\n                 fixed=None):\n        self.discretize_class = discretize_class\n        self.method = method\n        self.clean = clean\n        self.fixed = fixed\n\n    def __call__(self, data, fixed=None):\n        \"\"\"\n        Compute and return discretized domain.\n\n        :param data: Data to discretize.\n        \"\"\"\n\n        def transform_list(s, fixed=None):\n            new_vars = []\n            for var in s:\n                if var.is_continuous:\n                    if fixed and var.name in fixed.keys():\n                        nv = method(data, var, fixed)\n                    else:\n                        nv = method(data, var)\n                    if not self.clean or len(nv.values) > 1:\n                        new_vars.append(nv)\n                else:\n                    new_vars.append(var)\n            return new_vars\n        if self.method is None:\n            method = EqualFreq(n=4)\n        else:\n            method = self.method\n        domain = data.domain\n        new_attrs = transform_list(domain.attributes, fixed or self.fixed)\n        if self.discretize_class:\n            new_classes = transform_list(domain.class_vars)\n        else:\n            new_classes = domain.class_vars\n        return Domain(new_attrs, new_classes)\n",
            "header": {
                "file": {
                    "path": "Orange/preprocess/discretize.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "f16a3f812",
                "new_commit_hash": "1502b97f0",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/preprocess/discretize.py"
            },
            "plus_file": {
                "path": "b/Orange/preprocess/discretize.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 320,
                            "length": 8
                        },
                        "new_range": {
                            "start": 320,
                            "length": 11
                        },
                        "section": "def decimal_binnings("
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        nbins = np.round((mx_ - mn_) / width)",
                                "type": "context"
                            },
                            {
                                "content": "        if min_bins <= nbins <= max_bins \\",
                                "type": "context"
                            },
                            {
                                "content": "                and (not bins or bins[-1].nbins != nbins):",
                                "type": "context"
                            },
                            {
                                "content": "            bin_def = BinDefinition(mn_ + width * np.arange(nbins + 1),",
                                "type": "deleted"
                            },
                            {
                                "content": "                                    label_fmt, None, width)",
                                "type": "deleted"
                            },
                            {
                                "content": "            bins_ = mn_ + width * np.arange(nbins + 1)",
                                "type": "added"
                            },
                            {
                                "content": "            # to prevent values on the edge of the bin fall in the wrong bin",
                                "type": "added"
                            },
                            {
                                "content": "            # due to precision error on decimals that are not precise",
                                "type": "added"
                            },
                            {
                                "content": "            bins_ = np.around(bins_, decimals=np.finfo(bins_.dtype).precision)",
                                "type": "added"
                            },
                            {
                                "content": "            bin_def = BinDefinition(bins_, label_fmt, None, width)",
                                "type": "added"
                            },
                            {
                                "content": "            bins.append(bin_def)",
                                "type": "context"
                            },
                            {
                                "content": "    return bins",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/preprocess/discretize.py",
                            "type": "function",
                            "name": "decimal_binnings",
                            "content": "def decimal_binnings(\n        data, *, min_width=0, min_bins=2, max_bins=50,\n        min_unique=5, add_unique=0,\n        factors=(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20),\n        label_fmt=\"%g\"):\n    \"\"\"\n    Find a set of nice splits of data into bins\n\n    The function first computes the scaling factor that is, the power of 10\n    that brings the interval of values within [0, 1]. For instances, if the\n    numbers come from interaval 10004001 and 10007005, the width of the\n    interval is 3004, so the scaling factor is 1000.\n\n    The function next considers bin widths that are products of scaling and\n    different factors from 20 to 0.01 that make sense in decimal scale\n    (see default value for argument `factors`). For each width, it rounds the\n    minimal value down to this width and the maximal value up, and it computes\n    the number of bins of that width that fit between these two values.\n    If the number of bins is between `min_bins` and `max_bins`, and the width\n    is at least `min_width`, this is a valid interval.\n\n    If the data has no more than `min_unique` unique values, the function will\n    add a set of bins that put each value into its own bin.\n\n    If the data has no more than `add_unique` values, that last bins will put\n    each value into its own bin.\n\n    Args:\n        data (np.ndarray):\n            vector of data points; values may repeat, and nans and infs are\n            filtered out.\n        min_width (float): minimal bin width\n        min_bins (int): minimal number of bins\n        max_bins (int):\n            maximal number of bins; the number of bins will never exceed the\n            number of unique values\n        min_unique (int):\n            if the number of unique values are less or equal to `min_unique`,\n            the function returns a single binning that matches that values in\n            the data\n        add_unique (int):\n            similar to `min_unique` except that such bins are added to the list;\n            set to 0 to disable\n        factors (list of float):\n            The factors with which the scaling is multiplied. Default is\n            `(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20)`,\n            so if scaling is 1000, considered bin widths are 20000, 10000,\n            5000, 2000, 1000, 500, 250, 200, 100, 50, 25, 20 and 10.\n        label_fmt (str or Callable):\n            A format string (default: \"%g\") used for threshold labels,\n            or a function for formatting thresholds (e.g. var.str_val)\n\n    Returns:\n        bin_boundaries (list of np.ndarray): a list of bin boundaries,\n            including the top boundary of the last interval, hence the list\n            size equals the number bins + 1. These array match the `bin`\n            argument of `numpy.histogram`.\n\n            This is returned if `return_defs` is left `True`.\n\n        bin_definition (list of BinDefinition):\n            `BinDefinition` is a named tuple containing the beginning of the\n            first bin (`start`), number of bins (`nbins`) and their widths\n            (`width`). The last value can also be a `nd.array` with `nbins + 1`\n            elements, which describes bins of unequal width and is used for\n            binnings that match the unique values in the data (see `min_unique`\n            and `add_unique`).\n\n            This is returned if `return_defs` is `False`.\n    \"\"\"\n    bins = []\n\n    mn, mx, unique = _min_max_unique(data)\n    if len(unique) <= max(min_unique, add_unique):\n        bins.append(BinDefinition(_unique_thresholds(unique), label_fmt))\n        if len(unique) <= min_unique:\n            return bins\n\n    diff = mx - mn\n    f10 = 10 ** -np.floor(np.log10(diff))\n    max_bins = min(max_bins, len(unique))\n    for f in factors:\n        width = f / f10\n        if width < min_width:\n            continue\n        mn_ = np.floor(mn / width) * width\n        mx_ = np.ceil(mx / width) * width\n        nbins = np.round((mx_ - mn_) / width)\n        if min_bins <= nbins <= max_bins \\\n                and (not bins or bins[-1].nbins != nbins):\n            bin_def = BinDefinition(mn_ + width * np.arange(nbins + 1),\n                                    label_fmt, None, width)\n            bins.append(bin_def)\n    return bins",
                            "ast_type_str": "FunctionDef",
                            "start_lineno": 233,
                            "end_lineno": 326,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\n\nimport sys\nimport random\nfrom unittest import TestCase\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom Orange.preprocess import discretize, Discretize\nfrom Orange import data\nfrom Orange.data import Table, Instance, Domain, ContinuousVariable, DiscreteVariable\n\n\n# noinspection PyPep8Naming\nfrom Orange.widgets.tests.utils import table_dense_sparse\n\n\nclass TestEqualFreq(TestCase):\n    def test_equifreq_with_too_few_values(self):\n        s = [0] * 50 + [1] * 50\n        random.shuffle(s)\n        X = np.array(s).reshape((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 2)\n        self.assertEqual(dvar.compute_value.points, [0.5])\n\n    def test_equifreq_100_to_4(self):\n        X = np.arange(100).reshape((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [24.5, 49.5, 74.5])\n\n    def test_equifreq_with_k_instances(self):\n        X = np.array([[1], [2], [3], [4]])\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [1.5, 2.5, 3.5])\n\n    def test_below_precision(self):\n        eps = sys.float_info.epsilon\n\n        # Test with n >= number of distinct values\n        X = np.array([[1], [1 + eps], [1 + 2 * eps], [1 + 3 * eps]])\n        # Test the test: check that these are indeed distinct values\n        assert len(np.unique(X).flatten()) == 4\n        table = data.Table.from_numpy(None, X)\n        var = discretize.EqualFreq(n=4)(table, table.domain[0])\n        points = var.compute_value.points\n        self.assertEqual(len(np.unique(points)), len(points))\n\n        # Test with n < number of distinct values\n        X = np.array([[1 + i * eps] for i in range(10)])\n        # Test the test: check that these are indeed distinct values\n        assert len(np.unique(X).flatten()) == 10\n        table = data.Table.from_numpy(None, X)\n        var = discretize.EqualFreq(n=8)(table, table.domain[0])\n        points = var.compute_value.points\n        self.assertEqual(len(np.unique(points)), len(points))\n\n# noinspection PyPep8Naming\nclass TestEqualWidth(TestCase):\n    def test_equalwidth_on_two_values(self):\n        s = [0] * 50 + [1] * 50\n        random.shuffle(s)\n        X = np.array(s).reshape((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualWidth(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [0.25, 0.5, 0.75])\n\n    @table_dense_sparse\n    def test_equalwidth_100_to_4(self, prepare_table):\n        X = np.arange(101).reshape((101, 1))\n        table = prepare_table(data.Table.from_numpy(None, X))\n        disc = discretize.EqualWidth(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [25, 50, 75])\n\n    def test_equalwidth_const_value(self):\n        X = np.ones((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 1)\n        self.assertEqual(dvar.compute_value.points, [])\n\n\n# noinspection PyPep8Naming\nclass TestEntropyMDL(TestCase):\n    def test_entropy_with_two_values(self):\n        s = [0] * 50 + [1] * 50\n        random.shuffle(s)\n        X = np.array(s).reshape((100, 1))\n        table = data.Table.from_numpy(None, X, X)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 2)\n        self.assertEqual(dvar.compute_value.points, [0.5])\n\n    def test_entropy_with_two_values_useless(self):\n        X = np.array([0] * 50 + [1] * 50).reshape((100, 1))\n        Y = np.array([0] * 25 + [1] * 50 + [0] * 25)\n        table = data.Table.from_numpy(None, X, Y)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 1)\n        self.assertEqual(dvar.compute_value.points, [])\n\n    def test_entropy_constant(self):\n        X = np.zeros((100, 1))\n        domain = Domain([ContinuousVariable('v1')],\n                        [DiscreteVariable('c1', values=(\"1\",))])\n        table = data.Table(domain, X, X)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 1)\n        self.assertEqual(dvar.compute_value.points, [])\n\n    def test_entropy(self):\n        X = np.array([0] * 25 + [1] * 25 + [2] * 25 + [3] * 25\n                    ).reshape((100, 1))\n        Y = np.array([0] * 25 + [1] * 75)\n        table = data.Table.from_numpy(None, X, Y)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 2)\n        self.assertEqual(dvar.compute_value.points, [0.5])\n\n\n# noinspection PyPep8Naming\nclass TestDiscretizer(TestCase):\n    def setUp(self):\n        self.var = data.ContinuousVariable(\"x\", number_of_decimals=1)\n\n    def test_create_discretized_var(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        self.assertIsInstance(dvar.compute_value,\n                              discretize.Discretizer)\n        self.assertEqual(dvar.compute_value.points, [1, 2, 3])\n\n\n    def test_create_discretized_var_formatting(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        self.assertEqual(dvar.values, (\"< 1\", \"1 - 2\", \"2 - 3\", \"≥ 3\"))\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [10])\n        self.assertEqual(dvar.values, (\"< 10\", \"≥ 10\"))\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [10.1234])\n        self.assertEqual(dvar.values, (\"< 10.123\", \"≥ 10.123\"))\n\n        self.var.number_of_decimals = 3\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [5, 10.25])\n        self.assertEqual(dvar.values, (\"< 5\", \"5 - 10.25\", \"≥ 10.25\"))\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [5, 10.1234])\n        self.assertEqual(dvar.values, (\"< 5\", \"5 - 10.1234\", \"≥ 10.1234\"))\n\n    def test_discretizer_computation(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        X = np.array([0, 0.9, 1, 1.1, 1.9, 2, 2.5, 3, 3.5])\n        np.testing.assert_equal(dvar.compute_value.transform(X), np.floor(X))\n\n    def test_discretizer_computation_sparse(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        X = sp.csr_matrix(np.array([0, 0.9, 1, 1.1, 1.9, 2, 2.5, 3, 3.5]))\n        self.assertEqual((dvar.compute_value.transform(X) != X.floor()).nnz, 0)\n\n    def test_discretizer_computation_sparse_no_points(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [])\n        X = sp.csr_matrix(np.array([0, 0.9, 1, 1.1, 1.9, 2, 2.5, 3, 3.5]))\n        empty = sp.csr_matrix(X.shape)\n        self.assertEqual((dvar.compute_value.transform(X) != empty).nnz, 0)\n\n    def test_transform(self):\n        table = data.Table('iris')\n        table2 = Discretize()(table)\n        ins = data.Instance(table2.domain, table[0])\n        table3 = table[:10].transform(table2.domain)\n        self.assertEqual(ins, table3[0])\n\n    def test_remove_constant(self):\n        table = data.Table('iris')\n        table[:, 0] = 1\n        discretize = Discretize(remove_const=True)\n        new_table = discretize(table)\n        self.assertNotEqual(len(table.domain.attributes),\n                            len(new_table.domain.attributes))\n\n    def test_keep_constant(self):\n        table = data.Table('iris')\n        table[:, 0] = 1\n        discretize = Discretize(remove_const=False)\n        new_table = discretize(table)\n        self.assertEqual(len(table.domain.attributes),\n                         len(new_table.domain.attributes))\n\n    def test_discretize_class(self):\n        table = data.Table('iris')\n        domain = table.domain\n        regr_domain = data.Domain(domain.attributes[:3],\n                                  [domain.attributes[3], domain.class_var])\n        table = data.Table.from_table(regr_domain, table)\n\n        discretize = Discretize(remove_const=False)\n        new_table = discretize(table)\n        self.assertIs(new_table.domain.class_vars[0],\n                      new_table.domain.class_vars[0])\n        self.assertIs(new_table.domain.class_vars[1],\n                      new_table.domain.class_vars[1])\n\n        discretize = Discretize(remove_const=False, discretize_classes=True)\n        new_table = discretize(table)\n        self.assertIsInstance(new_table.domain.class_vars[0], DiscreteVariable)\n        self.assertIs(new_table.domain.class_vars[1],\n                      new_table.domain.class_vars[1])\n\n    def test_discretize_metas(self):\n        table = data.Table('iris')\n        domain = table.domain\n        regr_domain = data.Domain(domain.attributes[:3],\n                                  [],\n                                  [domain.attributes[3], domain.class_var])\n        table = data.Table.from_table(regr_domain, table)\n\n        discretize = Discretize(remove_const=False)\n        new_table = discretize(table)\n        self.assertIs(new_table.domain.metas[0],\n                      new_table.domain.metas[0])\n        self.assertIs(new_table.domain.metas[1],\n                      new_table.domain.metas[1])\n\n        discretize = Discretize(remove_const=False, discretize_metas=True)\n        new_table = discretize(table)\n        self.assertIsInstance(new_table.domain.metas[0], DiscreteVariable)\n        self.assertIs(new_table.domain.metas[1],\n                      new_table.domain.metas[1])\n\n\n# noinspection PyPep8Naming\nclass TestDiscretizeTable(TestCase):\n    @classmethod\n    def setUpClass(cls):\n        s = [0] * 50 + [1] * 50\n        X1 = np.array(s).reshape((100, 1))\n        X2 = np.arange(100).reshape((100, 1))\n        X3 = np.ones((100, 1))\n        X = np.hstack([X1, X2, X3])\n        cls.table_no_class = data.Table.from_numpy(None, X)\n        cls.table_class = data.Table.from_numpy(None, X, X1)\n\n    def test_discretize_exclude_constant(self):\n        dom = discretize.DomainDiscretizer()(self.table_no_class)\n        self.assertEqual(len(dom.attributes), 2)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n\n        dom = discretize.DomainDiscretizer(clean=False)(self.table_no_class)\n        self.assertEqual(len(dom.attributes), 3)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n        self.assertEqual(dom[2].compute_value.points, [])\n\n        dom = discretize.DomainDiscretizer()(self.table_class)\n        self.assertEqual(len(dom.attributes), 2)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n\n    def test_discretize_class(self):\n        dom = discretize.DomainDiscretizer()(self.table_class)\n        self.assertIs(dom.class_var, self.table_class.domain.class_var)\n\n        dom = discretize.DomainDiscretizer(discretize_class=True)\n        dom = dom(self.table_class)\n        self.assertIs(dom.class_var, self.table_class.domain.class_var)\n\n    def test_method(self):\n        dom = discretize.DomainDiscretizer()(self.table_class)\n        self.assertEqual(len(dom[1].values), 4)\n\n        dom = discretize.DomainDiscretizer(method=discretize.EqualWidth(n=2))\n        dom = dom(self.table_class)\n        self.assertEqual(len(dom[1].values), 2)\n\n    def test_fixed(self):\n        dom = discretize.DomainDiscretizer(method=discretize.EqualWidth(n=2),\n                                           fixed={\"Feature 2\": [1, 11]})\n        dom = dom(self.table_no_class)\n        self.assertEqual(len(dom.attributes), 2)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [6])\n\n    def test_leave_discrete(self):\n        s = [0] * 50 + [1] * 50\n        X1 = np.array(s).reshape((100, 1))\n        X2 = np.arange(100).reshape((100, 1))\n        X3 = np.ones((100, 1))\n        X = np.hstack([X1, X2, X3])\n        domain = data.Domain([data.DiscreteVariable(\"a\", values=\"MF\"),\n                              data.ContinuousVariable(\"b\"),\n                              data.DiscreteVariable(\"c\", values=\"AB\")],\n                             data.ContinuousVariable(\"d\"))\n        table = data.Table(domain, X, X1)\n        dom = discretize.DomainDiscretizer()(table)\n        self.assertIs(dom[0], table.domain[0])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n        self.assertIs(dom[2], table.domain[2])\n        self.assertIs(dom.class_var, table.domain.class_var)\n\n        domain = data.Domain([data.DiscreteVariable(\"a\", values=\"MF\"),\n                              data.ContinuousVariable(\"b\"),\n                              data.DiscreteVariable(\"c\", values=\"AB\")],\n                             data.DiscreteVariable(\"d\"))\n        table = data.Table(domain, X, X1)\n        dom = discretize.DomainDiscretizer()(table)\n        self.assertIs(dom[0], table.domain[0])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n        self.assertIs(dom[2], table.domain[2])\n        self.assertIs(dom.class_var, table.domain.class_var)\n\n\nclass TestInstanceConversion(TestCase):\n    def test_single_instance(self):\n        iris = Table(\"iris\")\n        inst = Instance(iris.domain, [5.2, 3.8, 1.4, 0.5, \"Iris-virginica\"])\n        d_iris = Discretize()(iris)\n        Instance(d_iris.domain, inst)\n",
            "new_file_content": "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\n\nimport sys\nimport random\nfrom unittest import TestCase\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom Orange.preprocess import discretize, Discretize, decimal_binnings\nfrom Orange import data\nfrom Orange.data import Table, Instance, Domain, ContinuousVariable, DiscreteVariable\n\n\n# noinspection PyPep8Naming\nfrom Orange.widgets.tests.utils import table_dense_sparse\n\n\nclass TestEqualFreq(TestCase):\n    def test_equifreq_with_too_few_values(self):\n        s = [0] * 50 + [1] * 50\n        random.shuffle(s)\n        X = np.array(s).reshape((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 2)\n        self.assertEqual(dvar.compute_value.points, [0.5])\n\n    def test_equifreq_100_to_4(self):\n        X = np.arange(100).reshape((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [24.5, 49.5, 74.5])\n\n    def test_equifreq_with_k_instances(self):\n        X = np.array([[1], [2], [3], [4]])\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [1.5, 2.5, 3.5])\n\n    def test_below_precision(self):\n        eps = sys.float_info.epsilon\n\n        # Test with n >= number of distinct values\n        X = np.array([[1], [1 + eps], [1 + 2 * eps], [1 + 3 * eps]])\n        # Test the test: check that these are indeed distinct values\n        assert len(np.unique(X).flatten()) == 4\n        table = data.Table.from_numpy(None, X)\n        var = discretize.EqualFreq(n=4)(table, table.domain[0])\n        points = var.compute_value.points\n        self.assertEqual(len(np.unique(points)), len(points))\n\n        # Test with n < number of distinct values\n        X = np.array([[1 + i * eps] for i in range(10)])\n        # Test the test: check that these are indeed distinct values\n        assert len(np.unique(X).flatten()) == 10\n        table = data.Table.from_numpy(None, X)\n        var = discretize.EqualFreq(n=8)(table, table.domain[0])\n        points = var.compute_value.points\n        self.assertEqual(len(np.unique(points)), len(points))\n\n# noinspection PyPep8Naming\nclass TestEqualWidth(TestCase):\n    def test_equalwidth_on_two_values(self):\n        s = [0] * 50 + [1] * 50\n        random.shuffle(s)\n        X = np.array(s).reshape((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualWidth(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [0.25, 0.5, 0.75])\n\n    @table_dense_sparse\n    def test_equalwidth_100_to_4(self, prepare_table):\n        X = np.arange(101).reshape((101, 1))\n        table = prepare_table(data.Table.from_numpy(None, X))\n        disc = discretize.EqualWidth(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [25, 50, 75])\n\n    def test_equalwidth_const_value(self):\n        X = np.ones((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 1)\n        self.assertEqual(dvar.compute_value.points, [])\n\n\nclass TestBinning(TestCase):\n    def test_decimal_binnings(self):\n        values = np.array([\n            -0.2, -0.2, -0.6, 1.0, 0.2, -0.6, 0.6, 1.0, 0.4, -0.5, -0.4, -0.4,\n            -0.6, 0.6, 0.75, 0.4, -0.2, 0.2, 0.0, 0.0, -1.0, -0.6, -0.2, -0.6,\n        ])\n        binning = decimal_binnings(values, factors=[0.2, 0.25, 0.5])\n        self.assertEqual(len(binning), 3)\n\n        np.testing.assert_array_equal(\n            binning[0].thresholds,\n            [-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1]\n        )\n        self.assertEqual(binning[0].width, 0.2)\n\n        np.testing.assert_array_equal(\n            binning[1].thresholds,\n            [-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1]\n        )\n        self.assertEqual(binning[1].width, 0.25)\n\n        np.testing.assert_array_equal(\n            binning[2].thresholds,\n            [-1, -0.5, 0, 0.5, 1]\n        )\n        self.assertEqual(binning[2].width, 0.5)\n\n\n# noinspection PyPep8Naming\nclass TestEntropyMDL(TestCase):\n    def test_entropy_with_two_values(self):\n        s = [0] * 50 + [1] * 50\n        random.shuffle(s)\n        X = np.array(s).reshape((100, 1))\n        table = data.Table.from_numpy(None, X, X)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 2)\n        self.assertEqual(dvar.compute_value.points, [0.5])\n\n    def test_entropy_with_two_values_useless(self):\n        X = np.array([0] * 50 + [1] * 50).reshape((100, 1))\n        Y = np.array([0] * 25 + [1] * 50 + [0] * 25)\n        table = data.Table.from_numpy(None, X, Y)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 1)\n        self.assertEqual(dvar.compute_value.points, [])\n\n    def test_entropy_constant(self):\n        X = np.zeros((100, 1))\n        domain = Domain([ContinuousVariable('v1')],\n                        [DiscreteVariable('c1', values=(\"1\",))])\n        table = data.Table(domain, X, X)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 1)\n        self.assertEqual(dvar.compute_value.points, [])\n\n    def test_entropy(self):\n        X = np.array([0] * 25 + [1] * 25 + [2] * 25 + [3] * 25\n                    ).reshape((100, 1))\n        Y = np.array([0] * 25 + [1] * 75)\n        table = data.Table.from_numpy(None, X, Y)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 2)\n        self.assertEqual(dvar.compute_value.points, [0.5])\n\n\n# noinspection PyPep8Naming\nclass TestDiscretizer(TestCase):\n    def setUp(self):\n        self.var = data.ContinuousVariable(\"x\", number_of_decimals=1)\n\n    def test_create_discretized_var(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        self.assertIsInstance(dvar.compute_value,\n                              discretize.Discretizer)\n        self.assertEqual(dvar.compute_value.points, [1, 2, 3])\n\n\n    def test_create_discretized_var_formatting(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        self.assertEqual(dvar.values, (\"< 1\", \"1 - 2\", \"2 - 3\", \"≥ 3\"))\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [10])\n        self.assertEqual(dvar.values, (\"< 10\", \"≥ 10\"))\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [10.1234])\n        self.assertEqual(dvar.values, (\"< 10.123\", \"≥ 10.123\"))\n\n        self.var.number_of_decimals = 3\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [5, 10.25])\n        self.assertEqual(dvar.values, (\"< 5\", \"5 - 10.25\", \"≥ 10.25\"))\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [5, 10.1234])\n        self.assertEqual(dvar.values, (\"< 5\", \"5 - 10.1234\", \"≥ 10.1234\"))\n\n    def test_discretizer_computation(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        X = np.array([0, 0.9, 1, 1.1, 1.9, 2, 2.5, 3, 3.5])\n        np.testing.assert_equal(dvar.compute_value.transform(X), np.floor(X))\n\n    def test_discretizer_computation_sparse(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        X = sp.csr_matrix(np.array([0, 0.9, 1, 1.1, 1.9, 2, 2.5, 3, 3.5]))\n        self.assertEqual((dvar.compute_value.transform(X) != X.floor()).nnz, 0)\n\n    def test_discretizer_computation_sparse_no_points(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [])\n        X = sp.csr_matrix(np.array([0, 0.9, 1, 1.1, 1.9, 2, 2.5, 3, 3.5]))\n        empty = sp.csr_matrix(X.shape)\n        self.assertEqual((dvar.compute_value.transform(X) != empty).nnz, 0)\n\n    def test_transform(self):\n        table = data.Table('iris')\n        table2 = Discretize()(table)\n        ins = data.Instance(table2.domain, table[0])\n        table3 = table[:10].transform(table2.domain)\n        self.assertEqual(ins, table3[0])\n\n    def test_remove_constant(self):\n        table = data.Table('iris')\n        table[:, 0] = 1\n        discretize = Discretize(remove_const=True)\n        new_table = discretize(table)\n        self.assertNotEqual(len(table.domain.attributes),\n                            len(new_table.domain.attributes))\n\n    def test_keep_constant(self):\n        table = data.Table('iris')\n        table[:, 0] = 1\n        discretize = Discretize(remove_const=False)\n        new_table = discretize(table)\n        self.assertEqual(len(table.domain.attributes),\n                         len(new_table.domain.attributes))\n\n    def test_discretize_class(self):\n        table = data.Table('iris')\n        domain = table.domain\n        regr_domain = data.Domain(domain.attributes[:3],\n                                  [domain.attributes[3], domain.class_var])\n        table = data.Table.from_table(regr_domain, table)\n\n        discretize = Discretize(remove_const=False)\n        new_table = discretize(table)\n        self.assertIs(new_table.domain.class_vars[0],\n                      new_table.domain.class_vars[0])\n        self.assertIs(new_table.domain.class_vars[1],\n                      new_table.domain.class_vars[1])\n\n        discretize = Discretize(remove_const=False, discretize_classes=True)\n        new_table = discretize(table)\n        self.assertIsInstance(new_table.domain.class_vars[0], DiscreteVariable)\n        self.assertIs(new_table.domain.class_vars[1],\n                      new_table.domain.class_vars[1])\n\n    def test_discretize_metas(self):\n        table = data.Table('iris')\n        domain = table.domain\n        regr_domain = data.Domain(domain.attributes[:3],\n                                  [],\n                                  [domain.attributes[3], domain.class_var])\n        table = data.Table.from_table(regr_domain, table)\n\n        discretize = Discretize(remove_const=False)\n        new_table = discretize(table)\n        self.assertIs(new_table.domain.metas[0],\n                      new_table.domain.metas[0])\n        self.assertIs(new_table.domain.metas[1],\n                      new_table.domain.metas[1])\n\n        discretize = Discretize(remove_const=False, discretize_metas=True)\n        new_table = discretize(table)\n        self.assertIsInstance(new_table.domain.metas[0], DiscreteVariable)\n        self.assertIs(new_table.domain.metas[1],\n                      new_table.domain.metas[1])\n\n\n# noinspection PyPep8Naming\nclass TestDiscretizeTable(TestCase):\n    @classmethod\n    def setUpClass(cls):\n        s = [0] * 50 + [1] * 50\n        X1 = np.array(s).reshape((100, 1))\n        X2 = np.arange(100).reshape((100, 1))\n        X3 = np.ones((100, 1))\n        X = np.hstack([X1, X2, X3])\n        cls.table_no_class = data.Table.from_numpy(None, X)\n        cls.table_class = data.Table.from_numpy(None, X, X1)\n\n    def test_discretize_exclude_constant(self):\n        dom = discretize.DomainDiscretizer()(self.table_no_class)\n        self.assertEqual(len(dom.attributes), 2)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n\n        dom = discretize.DomainDiscretizer(clean=False)(self.table_no_class)\n        self.assertEqual(len(dom.attributes), 3)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n        self.assertEqual(dom[2].compute_value.points, [])\n\n        dom = discretize.DomainDiscretizer()(self.table_class)\n        self.assertEqual(len(dom.attributes), 2)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n\n    def test_discretize_class(self):\n        dom = discretize.DomainDiscretizer()(self.table_class)\n        self.assertIs(dom.class_var, self.table_class.domain.class_var)\n\n        dom = discretize.DomainDiscretizer(discretize_class=True)\n        dom = dom(self.table_class)\n        self.assertIs(dom.class_var, self.table_class.domain.class_var)\n\n    def test_method(self):\n        dom = discretize.DomainDiscretizer()(self.table_class)\n        self.assertEqual(len(dom[1].values), 4)\n\n        dom = discretize.DomainDiscretizer(method=discretize.EqualWidth(n=2))\n        dom = dom(self.table_class)\n        self.assertEqual(len(dom[1].values), 2)\n\n    def test_fixed(self):\n        dom = discretize.DomainDiscretizer(method=discretize.EqualWidth(n=2),\n                                           fixed={\"Feature 2\": [1, 11]})\n        dom = dom(self.table_no_class)\n        self.assertEqual(len(dom.attributes), 2)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [6])\n\n    def test_leave_discrete(self):\n        s = [0] * 50 + [1] * 50\n        X1 = np.array(s).reshape((100, 1))\n        X2 = np.arange(100).reshape((100, 1))\n        X3 = np.ones((100, 1))\n        X = np.hstack([X1, X2, X3])\n        domain = data.Domain([data.DiscreteVariable(\"a\", values=\"MF\"),\n                              data.ContinuousVariable(\"b\"),\n                              data.DiscreteVariable(\"c\", values=\"AB\")],\n                             data.ContinuousVariable(\"d\"))\n        table = data.Table(domain, X, X1)\n        dom = discretize.DomainDiscretizer()(table)\n        self.assertIs(dom[0], table.domain[0])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n        self.assertIs(dom[2], table.domain[2])\n        self.assertIs(dom.class_var, table.domain.class_var)\n\n        domain = data.Domain([data.DiscreteVariable(\"a\", values=\"MF\"),\n                              data.ContinuousVariable(\"b\"),\n                              data.DiscreteVariable(\"c\", values=\"AB\")],\n                             data.DiscreteVariable(\"d\"))\n        table = data.Table(domain, X, X1)\n        dom = discretize.DomainDiscretizer()(table)\n        self.assertIs(dom[0], table.domain[0])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n        self.assertIs(dom[2], table.domain[2])\n        self.assertIs(dom.class_var, table.domain.class_var)\n\n\nclass TestInstanceConversion(TestCase):\n    def test_single_instance(self):\n        iris = Table(\"iris\")\n        inst = Instance(iris.domain, [5.2, 3.8, 1.4, 0.5, \"Iris-virginica\"])\n        d_iris = Discretize()(iris)\n        Instance(d_iris.domain, inst)\n",
            "header": {
                "file": {
                    "path": "Orange/tests/test_discretize.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "1b938f825",
                "new_commit_hash": "119ac8c86",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/tests/test_discretize.py"
            },
            "plus_file": {
                "path": "b/Orange/tests/test_discretize.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 8,
                            "length": 7
                        },
                        "new_range": {
                            "start": 8,
                            "length": 7
                        },
                        "section": "from unittest import TestCase"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "import numpy as np",
                                "type": "context"
                            },
                            {
                                "content": "import scipy.sparse as sp",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.preprocess import discretize, Discretize",
                                "type": "deleted"
                            },
                            {
                                "content": "from Orange.preprocess import discretize, Discretize, decimal_binnings",
                                "type": "added"
                            },
                            {
                                "content": "from Orange import data",
                                "type": "context"
                            },
                            {
                                "content": "from Orange.data import Table, Instance, Domain, ContinuousVariable, DiscreteVariable",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/tests/test_discretize.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.preprocess import discretize, Discretize, decimal_binnings",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 11,
                            "end_lineno": 11,
                            "parent": null
                        }
                    ],
                    "deleted_entities": [
                        {
                            "file_name": "Orange/tests/test_discretize.py",
                            "type": "statement",
                            "name": "",
                            "content": "from Orange.preprocess import discretize, Discretize",
                            "ast_type_str": "ImportFrom",
                            "start_lineno": 11,
                            "end_lineno": 11,
                            "parent": null
                        }
                    ]
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 95,
                            "length": 6
                        },
                        "new_range": {
                            "start": 95,
                            "length": 34
                        },
                        "section": "class TestEqualWidth(TestCase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.assertEqual(dvar.compute_value.points, [])",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class TestBinning(TestCase):",
                                "type": "added"
                            },
                            {
                                "content": "    def test_decimal_binnings(self):",
                                "type": "added"
                            },
                            {
                                "content": "        values = np.array([",
                                "type": "added"
                            },
                            {
                                "content": "            -0.2, -0.2, -0.6, 1.0, 0.2, -0.6, 0.6, 1.0, 0.4, -0.5, -0.4, -0.4,",
                                "type": "added"
                            },
                            {
                                "content": "            -0.6, 0.6, 0.75, 0.4, -0.2, 0.2, 0.0, 0.0, -1.0, -0.6, -0.2, -0.6,",
                                "type": "added"
                            },
                            {
                                "content": "        ])",
                                "type": "added"
                            },
                            {
                                "content": "        binning = decimal_binnings(values, factors=[0.2, 0.25, 0.5])",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(len(binning), 3)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        np.testing.assert_array_equal(",
                                "type": "added"
                            },
                            {
                                "content": "            binning[0].thresholds,",
                                "type": "added"
                            },
                            {
                                "content": "            [-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1]",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(binning[0].width, 0.2)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        np.testing.assert_array_equal(",
                                "type": "added"
                            },
                            {
                                "content": "            binning[1].thresholds,",
                                "type": "added"
                            },
                            {
                                "content": "            [-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1]",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(binning[1].width, 0.25)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        np.testing.assert_array_equal(",
                                "type": "added"
                            },
                            {
                                "content": "            binning[2].thresholds,",
                                "type": "added"
                            },
                            {
                                "content": "            [-1, -0.5, 0, 0.5, 1]",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertEqual(binning[2].width, 0.5)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "# noinspection PyPep8Naming",
                                "type": "context"
                            },
                            {
                                "content": "class TestEntropyMDL(TestCase):",
                                "type": "context"
                            },
                            {
                                "content": "    def test_entropy_with_two_values(self):",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [
                        {
                            "file_name": "Orange/tests/test_discretize.py",
                            "type": "method",
                            "name": "TestBinning.test_decimal_binnings",
                            "content": "class TestBinning(TestCase):\n    def test_decimal_binnings(self):\n        values = np.array([\n            -0.2, -0.2, -0.6, 1.0, 0.2, -0.6, 0.6, 1.0, 0.4, -0.5, -0.4, -0.4,\n            -0.6, 0.6, 0.75, 0.4, -0.2, 0.2, 0.0, 0.0, -1.0, -0.6, -0.2, -0.6,\n        ])\n        binning = decimal_binnings(values, factors=[0.2, 0.25, 0.5])\n        self.assertEqual(len(binning), 3)\n\n        np.testing.assert_array_equal(\n            binning[0].thresholds,\n            [-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1]\n        )\n        self.assertEqual(binning[0].width, 0.2)\n\n        np.testing.assert_array_equal(\n            binning[1].thresholds,\n            [-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1]\n        )\n        self.assertEqual(binning[1].width, 0.25)\n\n        np.testing.assert_array_equal(\n            binning[2].thresholds,\n            [-1, -0.5, 0, 0.5, 1]\n        )\n        self.assertEqual(binning[2].width, 0.5)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 99,
                            "end_lineno": 123,
                            "parent": {
                                "file_name": "Orange/tests/test_discretize.py",
                                "type": "class",
                                "name": "TestBinning",
                                "content": "class TestBinning(TestCase):\n    def test_decimal_binnings(self):\n        values = np.array([\n            -0.2, -0.2, -0.6, 1.0, 0.2, -0.6, 0.6, 1.0, 0.4, -0.5, -0.4, -0.4,\n            -0.6, 0.6, 0.75, 0.4, -0.2, 0.2, 0.0, 0.0, -1.0, -0.6, -0.2, -0.6,\n        ])\n        binning = decimal_binnings(values, factors=[0.2, 0.25, 0.5])\n        self.assertEqual(len(binning), 3)\n\n        np.testing.assert_array_equal(\n            binning[0].thresholds,\n            [-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1]\n        )\n        self.assertEqual(binning[0].width, 0.2)\n\n        np.testing.assert_array_equal(\n            binning[1].thresholds,\n            [-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1]\n        )\n        self.assertEqual(binning[1].width, 0.25)\n\n        np.testing.assert_array_equal(\n            binning[2].thresholds,\n            [-1, -0.5, 0, 0.5, 1]\n        )\n        self.assertEqual(binning[2].width, 0.5)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 98,
                                "end_lineno": 123,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "Orange/tests/test_discretize.py",
                            "type": "class",
                            "name": "TestBinning",
                            "content": "class TestBinning(TestCase):\n    def test_decimal_binnings(self):\n        values = np.array([\n            -0.2, -0.2, -0.6, 1.0, 0.2, -0.6, 0.6, 1.0, 0.4, -0.5, -0.4, -0.4,\n            -0.6, 0.6, 0.75, 0.4, -0.2, 0.2, 0.0, 0.0, -1.0, -0.6, -0.2, -0.6,\n        ])\n        binning = decimal_binnings(values, factors=[0.2, 0.25, 0.5])\n        self.assertEqual(len(binning), 3)\n\n        np.testing.assert_array_equal(\n            binning[0].thresholds,\n            [-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1]\n        )\n        self.assertEqual(binning[0].width, 0.2)\n\n        np.testing.assert_array_equal(\n            binning[1].thresholds,\n            [-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1]\n        )\n        self.assertEqual(binning[1].width, 0.25)\n\n        np.testing.assert_array_equal(\n            binning[2].thresholds,\n            [-1, -0.5, 0, 0.5, 1]\n        )\n        self.assertEqual(binning[2].width, 0.5)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 98,
                            "end_lineno": 123,
                            "parent": null
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "56706b60e10e65481d206b5b6f7be5f84b66e4e0^",
    "new_commit_hash": "56706b60e10e65481d206b5b6f7be5f84b66e4e0",
    "commit_message": "Merge pull request #5411 from PrimozGodec/fix-distributions\n\nDistributions: fix bins that values on the edge fall in the right bin",
    "commit_date": "2021-04-30T16:54:35+02:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "56706b60e10e65481d206b5b6f7be5f84b66e4e0",
    "test_file_codes": [
        "# Test methods with long descriptive names can omit docstrings\n# pylint: disable=missing-docstring\n\nimport sys\nimport random\nfrom unittest import TestCase\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom Orange.preprocess import discretize, Discretize, decimal_binnings\nfrom Orange import data\nfrom Orange.data import Table, Instance, Domain, ContinuousVariable, DiscreteVariable\n\n\n# noinspection PyPep8Naming\nfrom Orange.widgets.tests.utils import table_dense_sparse\n\n\nclass TestEqualFreq(TestCase):\n    def test_equifreq_with_too_few_values(self):\n        s = [0] * 50 + [1] * 50\n        random.shuffle(s)\n        X = np.array(s).reshape((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 2)\n        self.assertEqual(dvar.compute_value.points, [0.5])\n\n    def test_equifreq_100_to_4(self):\n        X = np.arange(100).reshape((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [24.5, 49.5, 74.5])\n\n    def test_equifreq_with_k_instances(self):\n        X = np.array([[1], [2], [3], [4]])\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [1.5, 2.5, 3.5])\n\n    def test_below_precision(self):\n        eps = sys.float_info.epsilon\n\n        # Test with n >= number of distinct values\n        X = np.array([[1], [1 + eps], [1 + 2 * eps], [1 + 3 * eps]])\n        # Test the test: check that these are indeed distinct values\n        assert len(np.unique(X).flatten()) == 4\n        table = data.Table.from_numpy(None, X)\n        var = discretize.EqualFreq(n=4)(table, table.domain[0])\n        points = var.compute_value.points\n        self.assertEqual(len(np.unique(points)), len(points))\n\n        # Test with n < number of distinct values\n        X = np.array([[1 + i * eps] for i in range(10)])\n        # Test the test: check that these are indeed distinct values\n        assert len(np.unique(X).flatten()) == 10\n        table = data.Table.from_numpy(None, X)\n        var = discretize.EqualFreq(n=8)(table, table.domain[0])\n        points = var.compute_value.points\n        self.assertEqual(len(np.unique(points)), len(points))\n\n# noinspection PyPep8Naming\nclass TestEqualWidth(TestCase):\n    def test_equalwidth_on_two_values(self):\n        s = [0] * 50 + [1] * 50\n        random.shuffle(s)\n        X = np.array(s).reshape((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualWidth(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [0.25, 0.5, 0.75])\n\n    @table_dense_sparse\n    def test_equalwidth_100_to_4(self, prepare_table):\n        X = np.arange(101).reshape((101, 1))\n        table = prepare_table(data.Table.from_numpy(None, X))\n        disc = discretize.EqualWidth(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 4)\n        self.assertEqual(dvar.compute_value.points, [25, 50, 75])\n\n    def test_equalwidth_const_value(self):\n        X = np.ones((100, 1))\n        table = data.Table.from_numpy(None, X)\n        disc = discretize.EqualFreq(n=4)\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 1)\n        self.assertEqual(dvar.compute_value.points, [])\n\n\nclass TestBinning(TestCase):\n    def test_decimal_binnings(self):\n        values = np.array([\n            -0.2, -0.2, -0.6, 1.0, 0.2, -0.6, 0.6, 1.0, 0.4, -0.5, -0.4, -0.4,\n            -0.6, 0.6, 0.75, 0.4, -0.2, 0.2, 0.0, 0.0, -1.0, -0.6, -0.2, -0.6,\n        ])\n        binning = decimal_binnings(values, factors=[0.2, 0.25, 0.5])\n        self.assertEqual(len(binning), 3)\n\n        np.testing.assert_array_equal(\n            binning[0].thresholds,\n            [-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1]\n        )\n        self.assertEqual(binning[0].width, 0.2)\n\n        np.testing.assert_array_equal(\n            binning[1].thresholds,\n            [-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1]\n        )\n        self.assertEqual(binning[1].width, 0.25)\n\n        np.testing.assert_array_equal(\n            binning[2].thresholds,\n            [-1, -0.5, 0, 0.5, 1]\n        )\n        self.assertEqual(binning[2].width, 0.5)\n\n\n# noinspection PyPep8Naming\nclass TestEntropyMDL(TestCase):\n    def test_entropy_with_two_values(self):\n        s = [0] * 50 + [1] * 50\n        random.shuffle(s)\n        X = np.array(s).reshape((100, 1))\n        table = data.Table.from_numpy(None, X, X)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 2)\n        self.assertEqual(dvar.compute_value.points, [0.5])\n\n    def test_entropy_with_two_values_useless(self):\n        X = np.array([0] * 50 + [1] * 50).reshape((100, 1))\n        Y = np.array([0] * 25 + [1] * 50 + [0] * 25)\n        table = data.Table.from_numpy(None, X, Y)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 1)\n        self.assertEqual(dvar.compute_value.points, [])\n\n    def test_entropy_constant(self):\n        X = np.zeros((100, 1))\n        domain = Domain([ContinuousVariable('v1')],\n                        [DiscreteVariable('c1', values=(\"1\",))])\n        table = data.Table(domain, X, X)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 1)\n        self.assertEqual(dvar.compute_value.points, [])\n\n    def test_entropy(self):\n        X = np.array([0] * 25 + [1] * 25 + [2] * 25 + [3] * 25\n                    ).reshape((100, 1))\n        Y = np.array([0] * 25 + [1] * 75)\n        table = data.Table.from_numpy(None, X, Y)\n        disc = discretize.EntropyMDL()\n        dvar = disc(table, table.domain[0])\n        self.assertEqual(len(dvar.values), 2)\n        self.assertEqual(dvar.compute_value.points, [0.5])\n\n\n# noinspection PyPep8Naming\nclass TestDiscretizer(TestCase):\n    def setUp(self):\n        self.var = data.ContinuousVariable(\"x\", number_of_decimals=1)\n\n    def test_create_discretized_var(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        self.assertIsInstance(dvar.compute_value,\n                              discretize.Discretizer)\n        self.assertEqual(dvar.compute_value.points, [1, 2, 3])\n\n\n    def test_create_discretized_var_formatting(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        self.assertEqual(dvar.values, (\"< 1\", \"1 - 2\", \"2 - 3\", \"≥ 3\"))\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [10])\n        self.assertEqual(dvar.values, (\"< 10\", \"≥ 10\"))\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [10.1234])\n        self.assertEqual(dvar.values, (\"< 10.123\", \"≥ 10.123\"))\n\n        self.var.number_of_decimals = 3\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [5, 10.25])\n        self.assertEqual(dvar.values, (\"< 5\", \"5 - 10.25\", \"≥ 10.25\"))\n\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [5, 10.1234])\n        self.assertEqual(dvar.values, (\"< 5\", \"5 - 10.1234\", \"≥ 10.1234\"))\n\n    def test_discretizer_computation(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        X = np.array([0, 0.9, 1, 1.1, 1.9, 2, 2.5, 3, 3.5])\n        np.testing.assert_equal(dvar.compute_value.transform(X), np.floor(X))\n\n    def test_discretizer_computation_sparse(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [1, 2, 3])\n        X = sp.csr_matrix(np.array([0, 0.9, 1, 1.1, 1.9, 2, 2.5, 3, 3.5]))\n        self.assertEqual((dvar.compute_value.transform(X) != X.floor()).nnz, 0)\n\n    def test_discretizer_computation_sparse_no_points(self):\n        dvar = discretize.Discretizer.create_discretized_var(\n            self.var, [])\n        X = sp.csr_matrix(np.array([0, 0.9, 1, 1.1, 1.9, 2, 2.5, 3, 3.5]))\n        empty = sp.csr_matrix(X.shape)\n        self.assertEqual((dvar.compute_value.transform(X) != empty).nnz, 0)\n\n    def test_transform(self):\n        table = data.Table('iris')\n        table2 = Discretize()(table)\n        ins = data.Instance(table2.domain, table[0])\n        table3 = table[:10].transform(table2.domain)\n        self.assertEqual(ins, table3[0])\n\n    def test_remove_constant(self):\n        table = data.Table('iris')\n        table[:, 0] = 1\n        discretize = Discretize(remove_const=True)\n        new_table = discretize(table)\n        self.assertNotEqual(len(table.domain.attributes),\n                            len(new_table.domain.attributes))\n\n    def test_keep_constant(self):\n        table = data.Table('iris')\n        table[:, 0] = 1\n        discretize = Discretize(remove_const=False)\n        new_table = discretize(table)\n        self.assertEqual(len(table.domain.attributes),\n                         len(new_table.domain.attributes))\n\n    def test_discretize_class(self):\n        table = data.Table('iris')\n        domain = table.domain\n        regr_domain = data.Domain(domain.attributes[:3],\n                                  [domain.attributes[3], domain.class_var])\n        table = data.Table.from_table(regr_domain, table)\n\n        discretize = Discretize(remove_const=False)\n        new_table = discretize(table)\n        self.assertIs(new_table.domain.class_vars[0],\n                      new_table.domain.class_vars[0])\n        self.assertIs(new_table.domain.class_vars[1],\n                      new_table.domain.class_vars[1])\n\n        discretize = Discretize(remove_const=False, discretize_classes=True)\n        new_table = discretize(table)\n        self.assertIsInstance(new_table.domain.class_vars[0], DiscreteVariable)\n        self.assertIs(new_table.domain.class_vars[1],\n                      new_table.domain.class_vars[1])\n\n    def test_discretize_metas(self):\n        table = data.Table('iris')\n        domain = table.domain\n        regr_domain = data.Domain(domain.attributes[:3],\n                                  [],\n                                  [domain.attributes[3], domain.class_var])\n        table = data.Table.from_table(regr_domain, table)\n\n        discretize = Discretize(remove_const=False)\n        new_table = discretize(table)\n        self.assertIs(new_table.domain.metas[0],\n                      new_table.domain.metas[0])\n        self.assertIs(new_table.domain.metas[1],\n                      new_table.domain.metas[1])\n\n        discretize = Discretize(remove_const=False, discretize_metas=True)\n        new_table = discretize(table)\n        self.assertIsInstance(new_table.domain.metas[0], DiscreteVariable)\n        self.assertIs(new_table.domain.metas[1],\n                      new_table.domain.metas[1])\n\n\n# noinspection PyPep8Naming\nclass TestDiscretizeTable(TestCase):\n    @classmethod\n    def setUpClass(cls):\n        s = [0] * 50 + [1] * 50\n        X1 = np.array(s).reshape((100, 1))\n        X2 = np.arange(100).reshape((100, 1))\n        X3 = np.ones((100, 1))\n        X = np.hstack([X1, X2, X3])\n        cls.table_no_class = data.Table.from_numpy(None, X)\n        cls.table_class = data.Table.from_numpy(None, X, X1)\n\n    def test_discretize_exclude_constant(self):\n        dom = discretize.DomainDiscretizer()(self.table_no_class)\n        self.assertEqual(len(dom.attributes), 2)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n\n        dom = discretize.DomainDiscretizer(clean=False)(self.table_no_class)\n        self.assertEqual(len(dom.attributes), 3)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n        self.assertEqual(dom[2].compute_value.points, [])\n\n        dom = discretize.DomainDiscretizer()(self.table_class)\n        self.assertEqual(len(dom.attributes), 2)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n\n    def test_discretize_class(self):\n        dom = discretize.DomainDiscretizer()(self.table_class)\n        self.assertIs(dom.class_var, self.table_class.domain.class_var)\n\n        dom = discretize.DomainDiscretizer(discretize_class=True)\n        dom = dom(self.table_class)\n        self.assertIs(dom.class_var, self.table_class.domain.class_var)\n\n    def test_method(self):\n        dom = discretize.DomainDiscretizer()(self.table_class)\n        self.assertEqual(len(dom[1].values), 4)\n\n        dom = discretize.DomainDiscretizer(method=discretize.EqualWidth(n=2))\n        dom = dom(self.table_class)\n        self.assertEqual(len(dom[1].values), 2)\n\n    def test_fixed(self):\n        dom = discretize.DomainDiscretizer(method=discretize.EqualWidth(n=2),\n                                           fixed={\"Feature 2\": [1, 11]})\n        dom = dom(self.table_no_class)\n        self.assertEqual(len(dom.attributes), 2)\n        self.assertEqual(dom[0].compute_value.points, [0.5])\n        self.assertEqual(dom[1].compute_value.points, [6])\n\n    def test_leave_discrete(self):\n        s = [0] * 50 + [1] * 50\n        X1 = np.array(s).reshape((100, 1))\n        X2 = np.arange(100).reshape((100, 1))\n        X3 = np.ones((100, 1))\n        X = np.hstack([X1, X2, X3])\n        domain = data.Domain([data.DiscreteVariable(\"a\", values=\"MF\"),\n                              data.ContinuousVariable(\"b\"),\n                              data.DiscreteVariable(\"c\", values=\"AB\")],\n                             data.ContinuousVariable(\"d\"))\n        table = data.Table(domain, X, X1)\n        dom = discretize.DomainDiscretizer()(table)\n        self.assertIs(dom[0], table.domain[0])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n        self.assertIs(dom[2], table.domain[2])\n        self.assertIs(dom.class_var, table.domain.class_var)\n\n        domain = data.Domain([data.DiscreteVariable(\"a\", values=\"MF\"),\n                              data.ContinuousVariable(\"b\"),\n                              data.DiscreteVariable(\"c\", values=\"AB\")],\n                             data.DiscreteVariable(\"d\"))\n        table = data.Table(domain, X, X1)\n        dom = discretize.DomainDiscretizer()(table)\n        self.assertIs(dom[0], table.domain[0])\n        self.assertEqual(dom[1].compute_value.points, [24.5, 49.5, 74.5])\n        self.assertIs(dom[2], table.domain[2])\n        self.assertIs(dom.class_var, table.domain.class_var)\n\n\nclass TestInstanceConversion(TestCase):\n    def test_single_instance(self):\n        iris = Table(\"iris\")\n        inst = Instance(iris.domain, [5.2, 3.8, 1.4, 0.5, \"Iris-virginica\"])\n        d_iris = Discretize()(iris)\n        Instance(d_iris.domain, inst)\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nrunning build_ext\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nbuilding 'Orange.classification._tree_scorers' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o\ncreating build/lib.linux-x86_64-3.7\ncreating build/lib.linux-x86_64-3.7/Orange\ncreating build/lib.linux-x86_64-3.7/Orange/classification\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_contingency.c -o build/temp.linux-x86_64-3.7/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-3.7/Orange/data\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_io.c -o build/temp.linux-x86_64-3.7/Orange/data/_io.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_variable.c -o build/temp.linux-x86_64-3.7/Orange/data/_variable.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-3.7/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/distance/_distance.c -o build/temp.linux-x86_64-3.7/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-3.7/Orange/distance\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-3.7/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/projection/_som.c -o build/temp.linux-x86_64-3.7/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-3.7/Orange/projection\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._simple_tree' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-3.7/Orange/widgets\ncreating build/lib.linux-x86_64-3.7/Orange/widgets/utils\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nrunning develop\nrunning egg_info\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.29.0.dev0+56706b6 to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0\nProcessing dependencies for Orange3==3.29.0.dev0+56706b6\nSearching for XlsxWriter==3.2.0\nBest match: XlsxWriter 3.2.0\nAdding XlsxWriter 3.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for setuptools==59.8.0\nBest match: setuptools 59.8.0\nAdding setuptools 59.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for scipy==1.7.3\nBest match: scipy 1.7.3\nAdding scipy 1.7.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for scikit-learn==1.0.2\nBest match: scikit-learn 1.0.2\nAdding scikit-learn 1.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for requests==2.31.0\nBest match: requests 2.31.0\nAdding requests 2.31.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for PyYAML==6.0.1\nBest match: PyYAML 6.0.1\nAdding PyYAML 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for pyqtgraph==0.12.4\nBest match: pyqtgraph 0.12.4\nAdding pyqtgraph 0.12.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for pip==24.0\nBest match: pip 24.0\nAdding pip 24.0 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\nInstalling pip3.10 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for pandas==1.3.5\nBest match: pandas 1.3.5\nAdding pandas 1.3.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for orange-widget-base==4.22.0\nBest match: orange-widget-base 4.22.0\nAdding orange-widget-base 4.22.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for orange-canvas-core==0.1.35\nBest match: orange-canvas-core 0.1.35\nAdding orange-canvas-core 0.1.35 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for openpyxl==3.1.3\nBest match: openpyxl 3.1.3\nAdding openpyxl 3.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for numpy==1.17.5\nBest match: numpy 1.17.5\nAdding numpy 1.17.5 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\nInstalling f2py3.7 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for networkx==2.6.3\nBest match: networkx 2.6.3\nAdding networkx 2.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for matplotlib==3.5.3\nBest match: matplotlib 3.5.3\nAdding matplotlib 3.5.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for keyrings.alt==4.2.0\nBest match: keyrings.alt 4.2.0\nAdding keyrings.alt 4.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for keyring==24.1.1\nBest match: keyring 24.1.1\nAdding keyring 24.1.1 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for joblib==1.3.2\nBest match: joblib 1.3.2\nAdding joblib 1.3.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for httpx==0.16.1\nBest match: httpx 0.16.1\nAdding httpx 0.16.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for chardet==5.2.0\nBest match: chardet 5.2.0\nAdding chardet 5.2.0 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine==5.15.6\nBest match: PyQtWebEngine 5.15.6\nAdding PyQtWebEngine 5.15.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for PyQt5==5.15.10\nBest match: PyQt5 5.15.10\nAdding PyQt5 5.15.10 to easy-install.pth file\nInstalling pylupdate5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\nInstalling pyrcc5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\nInstalling pyuic5 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for threadpoolctl==3.1.0\nBest match: threadpoolctl 3.1.0\nAdding threadpoolctl 3.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for urllib3==2.0.7\nBest match: urllib3 2.0.7\nAdding urllib3 2.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for typing-extensions==4.7.1\nBest match: typing-extensions 4.7.1\nAdding typing-extensions 4.7.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for requests-cache==1.1.1\nBest match: requests-cache 1.1.1\nAdding requests-cache 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for packaging==24.0\nBest match: packaging 24.0\nAdding packaging 24.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for qasync==0.25.0\nBest match: qasync 0.25.0\nAdding qasync 0.25.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for importlib-metadata==6.7.0\nBest match: importlib-metadata 6.7.0\nAdding importlib-metadata 6.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for et-xmlfile==1.1.0\nBest match: et-xmlfile 1.1.0\nAdding et-xmlfile 1.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for fonttools==4.38.0\nBest match: fonttools 4.38.0\nAdding fonttools 4.38.0 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for Pillow==9.5.0\nBest match: Pillow 9.5.0\nAdding Pillow 9.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for kiwisolver==1.4.5\nBest match: kiwisolver 1.4.5\nAdding kiwisolver 1.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for cycler==0.11.0\nBest match: cycler 0.11.0\nAdding cycler 0.11.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for jaraco.classes==3.2.3\nBest match: jaraco.classes 3.2.3\nAdding jaraco.classes 3.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for importlib-resources==5.12.0\nBest match: importlib-resources 5.12.0\nAdding importlib-resources 5.12.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for rfc3986==1.5.0\nBest match: rfc3986 1.5.0\nAdding rfc3986 1.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for httpcore==0.12.3\nBest match: httpcore 0.12.3\nAdding httpcore 0.12.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for PyQtWebEngine-Qt5==5.15.16\nBest match: PyQtWebEngine-Qt5 5.15.16\nAdding PyQtWebEngine-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for PyQt5-sip==12.13.0\nBest match: PyQt5-sip 12.13.0\nAdding PyQt5-sip 12.13.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for PyQt5-Qt5==5.15.16\nBest match: PyQt5-Qt5 5.15.16\nAdding PyQt5-Qt5 5.15.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for cattrs==23.1.2\nBest match: cattrs 23.1.2\nAdding cattrs 23.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for attrs==24.2.0\nBest match: attrs 24.2.0\nAdding attrs 24.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for platformdirs==4.0.0\nBest match: platformdirs 4.0.0\nAdding platformdirs 4.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for zipp==3.15.0\nBest match: zipp 3.15.0\nAdding zipp 3.15.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for more-itertools==9.1.0\nBest match: more-itertools 9.1.0\nAdding more-itertools 9.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for h11==0.14.0\nBest match: h11 0.14.0\nAdding h11 0.14.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for cffi==1.15.1\nBest match: cffi 1.15.1\nAdding cffi 1.15.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nSearching for pycparser==2.21\nBest match: pycparser 2.21\nAdding pycparser 2.21 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages\nFinished processing dependencies for Orange3==3.29.0.dev0+56706b6\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.7\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 50ms\nPrepared 18 packages in 16ms\nInstalled 18 packages in 128ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\nResolved 53 packages in 277ms\nInstalled 47 packages in 671ms\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + certifi==2024.12.14\n + cffi==1.15.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + cryptography==44.0.0\n + cycler==0.11.0\n + et-xmlfile==1.1.0\n + fonttools==4.38.0\n + h11==0.14.0\n + httpcore==0.12.3\n + httpx==0.16.1\n + idna==3.10\n + importlib-resources==5.12.0\n + jaraco-classes==3.2.3\n + jeepney==0.8.0\n + joblib==1.3.2\n + keyring==24.1.1\n + keyrings-alt==4.2.0\n + kiwisolver==1.4.5\n + matplotlib==3.5.3\n + more-itertools==9.1.0\n + networkx==2.6.3\n + openpyxl==3.1.3\n + opentsne==1.0.1\n + pandas==1.3.5\n + pillow==9.5.0\n + pip==24.0\n + pycparser==2.21\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.1\n + requests==2.31.0\n + rfc3986==1.5.0\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + threadpoolctl==3.1.0\n + urllib3==2.0.7\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\nResolved 39 packages in 172ms\nInstalled 13 packages in 73ms\n + anyqt==0.2.0\n + attrs==24.2.0\n + cattrs==23.1.2\n + commonmark==0.9.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + platformdirs==4.0.0\n + pyqtgraph==0.12.4\n + qasync==0.25.0\n + requests-cache==1.1.1\n + url-normalize==1.4.3\nResolved 2 packages in 3ms\nInstalled 2 packages in 15ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 19 packages in 112ms\nInstalled 5 packages in 1.41s\n + catboost==1.2.7\n + graphviz==0.20.1\n + plotly==5.18.0\n + tenacity==8.2.3\n + xgboost==1.6.2\nAudited 2 packages in 1ms\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3413:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3413 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4869:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4869 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5615:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5615 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5736:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5736 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5742:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5742 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7202:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7202 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7857:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7857 |         for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7917:143: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7917 |               __pyx_t_15 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_14 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                               ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3863:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3863 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3862:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3862 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:4934:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4934 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4933:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4933 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4732:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4732 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4307:7: note: ‘__pyx_v_win_y’ was declared here\n 4307 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4721:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4721 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4306:7: note: ‘__pyx_v_win_x’ was declared here\n 4306 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5682:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5682 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5681:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5681 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3184:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3184 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2887:7: note: ‘__pyx_v_win_y’ was declared here\n 2887 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3173:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3173 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2886:7: note: ‘__pyx_v_win_x’ was declared here\n 2886 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3357:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3357 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/setuptools/command/easy_install.py:159: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.\n  EasyInstallDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching 'COPYING'\n",
    "new_commit_res_code": 0,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0\ncollected 28 items\n\nr2e_tests/test_1.py ............................                         [100%]\n\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestEqualFreq::test_below_precision\nPASSED r2e_tests/test_1.py::TestEqualFreq::test_equifreq_100_to_4\nPASSED r2e_tests/test_1.py::TestEqualFreq::test_equifreq_with_k_instances\nPASSED r2e_tests/test_1.py::TestEqualFreq::test_equifreq_with_too_few_values\nPASSED r2e_tests/test_1.py::TestEqualWidth::test_equalwidth_100_to_4\nPASSED r2e_tests/test_1.py::TestEqualWidth::test_equalwidth_const_value\nPASSED r2e_tests/test_1.py::TestEqualWidth::test_equalwidth_on_two_values\nPASSED r2e_tests/test_1.py::TestBinning::test_decimal_binnings\nPASSED r2e_tests/test_1.py::TestEntropyMDL::test_entropy\nPASSED r2e_tests/test_1.py::TestEntropyMDL::test_entropy_constant\nPASSED r2e_tests/test_1.py::TestEntropyMDL::test_entropy_with_two_values\nPASSED r2e_tests/test_1.py::TestEntropyMDL::test_entropy_with_two_values_useless\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_create_discretized_var\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_create_discretized_var_formatting\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_discretize_class\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_discretize_metas\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_discretizer_computation\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_discretizer_computation_sparse\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_discretizer_computation_sparse_no_points\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_keep_constant\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_remove_constant\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_transform\nPASSED r2e_tests/test_1.py::TestDiscretizeTable::test_discretize_class\nPASSED r2e_tests/test_1.py::TestDiscretizeTable::test_discretize_exclude_constant\nPASSED r2e_tests/test_1.py::TestDiscretizeTable::test_fixed\nPASSED r2e_tests/test_1.py::TestDiscretizeTable::test_leave_discrete\nPASSED r2e_tests/test_1.py::TestDiscretizeTable::test_method\nPASSED r2e_tests/test_1.py::TestInstanceConversion::test_single_instance\n============================== 28 passed in 2.04s ==============================\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.7.9, pytest-7.4.4, pluggy-1.2.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_56706b60e10e65481d206b5b6f7be5f84b66e4e0\ncollected 28 items\n\nr2e_tests/test_1.py .......F....................                         [100%]\n\n=================================== FAILURES ===================================\n______________________ TestBinning.test_decimal_binnings _______________________\n\nself = <r2e_tests.test_1.TestBinning testMethod=test_decimal_binnings>\n\n    def test_decimal_binnings(self):\n        values = np.array([\n            -0.2, -0.2, -0.6, 1.0, 0.2, -0.6, 0.6, 1.0, 0.4, -0.5, -0.4, -0.4,\n            -0.6, 0.6, 0.75, 0.4, -0.2, 0.2, 0.0, 0.0, -1.0, -0.6, -0.2, -0.6,\n        ])\n        binning = decimal_binnings(values, factors=[0.2, 0.25, 0.5])\n        self.assertEqual(len(binning), 3)\n    \n        np.testing.assert_array_equal(\n            binning[0].thresholds,\n>           [-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1]\n        )\nE       AssertionError: \nE       Arrays are not equal\nE       \nE       Mismatched elements: 5 / 11 (45.5%)\nE       Max absolute difference: 1.66533454e-16\nE       Max relative difference: 8.32667268e-16\nE        x: array([-1. , -0.8, -0.6, -0.4, -0.2,  0. ,  0.2,  0.4,  0.6,  0.8,  1. ])\nE        y: array([-1. , -0.8, -0.6, -0.4, -0.2,  0. ,  0.2,  0.4,  0.6,  0.8,  1. ])\n\nr2e_tests/test_1.py:109: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestEqualFreq::test_below_precision\nPASSED r2e_tests/test_1.py::TestEqualFreq::test_equifreq_100_to_4\nPASSED r2e_tests/test_1.py::TestEqualFreq::test_equifreq_with_k_instances\nPASSED r2e_tests/test_1.py::TestEqualFreq::test_equifreq_with_too_few_values\nPASSED r2e_tests/test_1.py::TestEqualWidth::test_equalwidth_100_to_4\nPASSED r2e_tests/test_1.py::TestEqualWidth::test_equalwidth_const_value\nPASSED r2e_tests/test_1.py::TestEqualWidth::test_equalwidth_on_two_values\nPASSED r2e_tests/test_1.py::TestEntropyMDL::test_entropy\nPASSED r2e_tests/test_1.py::TestEntropyMDL::test_entropy_constant\nPASSED r2e_tests/test_1.py::TestEntropyMDL::test_entropy_with_two_values\nPASSED r2e_tests/test_1.py::TestEntropyMDL::test_entropy_with_two_values_useless\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_create_discretized_var\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_create_discretized_var_formatting\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_discretize_class\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_discretize_metas\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_discretizer_computation\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_discretizer_computation_sparse\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_discretizer_computation_sparse_no_points\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_keep_constant\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_remove_constant\nPASSED r2e_tests/test_1.py::TestDiscretizer::test_transform\nPASSED r2e_tests/test_1.py::TestDiscretizeTable::test_discretize_class\nPASSED r2e_tests/test_1.py::TestDiscretizeTable::test_discretize_exclude_constant\nPASSED r2e_tests/test_1.py::TestDiscretizeTable::test_fixed\nPASSED r2e_tests/test_1.py::TestDiscretizeTable::test_leave_discrete\nPASSED r2e_tests/test_1.py::TestDiscretizeTable::test_method\nPASSED r2e_tests/test_1.py::TestInstanceConversion::test_single_instance\nFAILED r2e_tests/test_1.py::TestBinning::test_decimal_binnings - AssertionErr...\n========================= 1 failed, 27 passed in 2.28s =========================\n",
    "old_commit_res_stderr": ""
}
Orange/preprocess/discretize.py Orange/tests/test_discretize.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Edge Values Assigned to Incorrect Bins Due to Floating Point Precision

**Description:**
When discretizing decimal values, values that lie exactly on the edge of a bin are sometimes assigned to the wrong bin. This issue seems to be caused by floating point precision errors in the binning thresholds, leading to incorrect bin assignments.

**Example:**
Consider the following code snippet used for binning decimal values:

```python
import numpy as np
from Orange.preprocess import decimal_binnings

values = np.array([
    -0.2, -0.2, -0.6, 1.0, 0.2, -0.6, 0.6, 1.0, 0.4, -0.5, -0.4, -0.4,
    -0.6, 0.6, 0.75, 0.4, -0.2, 0.2, 0.0, 0.0, -1.0, -0.6, -0.2, -0.6,
])
binning = decimal_binnings(values, factors=[0.2, 0.25, 0.5])
```

**Expected Behavior:**
The binning function should create precise bin thresholds so that values exactly on the edge fall into the correct bin. For example, with a bin width of 0.2, the thresholds should be `[-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1]`. This ensures that a value of `0.2` is correctly placed in its intended bin without falling into an adjacent bin due to precision errors.

**Actual Behavior:**
Due to floating point precision errors, the binning thresholds may have minor inaccuracies. This results in values that lie exactly on the bin edges, such as `0.2`, being assigned to the wrong bin. The discrepancies caused by these precision errors lead to failing tests that expect the binning thresholds to match exactly, even though they appear identical at a glance.

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/preprocess/discretize.py
import calendar
import re
import time
from typing import NamedTuple, List, Union, Callable
import datetime
from itertools import count

import numpy as np
import scipy.sparse as sp

from Orange.data import DiscreteVariable, Domain
from Orange.data.sql.table import SqlTable
from Orange.statistics import distribution, contingency, util as ut
from Orange.statistics.basic_stats import BasicStats
from Orange.util import Reprable, utc_from_timestamp
from .transformation import Transformation
from . import _discretize

__all__ = ["EqualFreq", "EqualWidth", "EntropyMDL", "DomainDiscretizer",
           "decimal_binnings", "time_binnings", "short_time_units",
           "BinDefinition"]


class Discretizer(Transformation):
    """Value transformer that returns an index of the bin for the given value.
    """
    def __init__(self, variable, points):
        super().__init__(variable)
        self.points = points

    @staticmethod
    def digitize(x, bins):
        if sp.issparse(x):
            if len(bins):
                x.data = np.digitize(x.data, bins)
            else:
                x = sp.csr_matrix(x.shape)
            return x
        else:
            return np.digitize(x, bins) if len(bins) else [0]*len(x)

    def transform(self, c):
        if sp.issparse(c):
            return self.digitize(c, self.points)
        elif c.size:
            return np.where(np.isnan(c), np.NaN, self.digitize(c, self.points))
        else:
            return np.array([], dtype=int)

    @staticmethod
    def _fmt_interval(low, high, formatter):
        assert low is not None or high is not None
        assert low is None or high is None or low < high
        if low is None or np.isinf(low):
            return f"< {formatter(high)}"
        if high is None or np.isinf(high):
            return f"≥ {formatter(low)}"
        return f"{formatter(low)} - {formatter(high)}"

    @classmethod
    def create_discretized_var(cls, var, points):
        def fmt(val):
            sval = var.str_val(val)
            # For decimal numbers, remove trailing 0's and . if no decimals left
            if re.match(r"^\d+\.\d+", sval):
                return sval.rstrip("0").rstrip(".")
            return sval

        lpoints = list(points)
        if lpoints:
            values = [
                cls._fmt_interval(low, high, fmt)
                for low, high in zip([-np.inf] + lpoints, lpoints + [np.inf])]
            to_sql = BinSql(var, lpoints)
        else:
            values = ["single_value"]
            to_sql = SingleValueSql(values[0])

        dvar = DiscreteVariable(name=var.name, values=values,
                                compute_value=cls(var, points),
                                sparse=var.sparse)
        dvar.source_variable = var
        dvar.to_sql = to_sql
        return dvar

    def __eq__(self, other):
        return super().__eq__(other) and self.points == other.points

    def __hash__(self):
        return hash((type(self), self.variable, tuple(self.points)))


class BinSql:
    def __init__(self, var, points):
        self.var = var
        self.points = points

    def __call__(self):
        return 'width_bucket(%s, ARRAY%s::double precision[])' % (
            self.var.to_sql(), str(self.points))


class SingleValueSql:
    def __init__(self, value):
        self.value = value

    def __call__(self):
        return "'%s'" % self.value


class Discretization(Reprable):
    """Abstract base class for discretization classes."""
    def __call__(self, data, variable):
        """
        Compute discretization of the given variable on the given data.
        Return a new variable with the appropriate domain
        (:obj:`Orange.data.DiscreteVariable.values`) and transformer
        (:obj:`Orange.data.Variable.compute_value`).
        """
        raise NotImplementedError(
            "Subclasses of 'Discretization' need to implement "
            "the call operator")


class EqualFreq(Discretization):
    """Discretization into bins with approximately equal number of data
    instances.

    .. attribute:: n

        Number of bins (default: 4). The actual number may be lower if the
        variable has less than n distinct values.
    """
    def __init__(self, n=4):
        self.n = n

    # noinspection PyProtectedMember
    def __call__(self, data, attribute):
        if type(data) == SqlTable:
            att = attribute.to_sql()
            quantiles = [(i + 1) / self.n for i in range(self.n - 1)]
            query = data._sql_query(
                ['quantile(%s, ARRAY%s)' % (att, str(quantiles))],
                use_time_sample=1000)
            with data._execute_sql_query(query) as cur:
                points = sorted(set(cur.fetchone()[0]))
        else:
            d = distribution.get_distribution(data, attribute)
            points = _discretize.split_eq_freq(d, self.n)
            # np.unique handles cases in which differences are below precision
            points = list(np.unique(points))
        return Discretizer.create_discretized_var(
            data.domain[attribute], points)

class EqualWidth(Discretization):
    """Discretization into a fixed number of bins with equal widths.

    .. attribute:: n

        Number of bins (default: 4).
    """
    def __init__(self, n=4):
        self.n = n

    # noinspection PyProtectedMember
    def __call__(self, data, attribute, fixed=None):
        if fixed:
            min, max = fixed[attribute.name]
            points = self._split_eq_width(min, max)
        else:
            if type(data) == SqlTable:
                stats = BasicStats(data, attribute)
                points = self._split_eq_width(stats.min, stats.max)
            else:
                values = data[:, attribute]
                values = values.X if values.X.size else values.Y
                if values.size:
                    min, max = ut.nanmin(values), ut.nanmax(values)
                    points = self._split_eq_width(min, max)
                else:
                    points = []
        return Discretizer.create_discretized_var(
            data.domain[attribute], points)

    def _split_eq_width(self, min, max):
        if np.isnan(min) or np.isnan(max) or min == max:
            return []
        dif = (max - min) / self.n
        return [min + (i + 1) * dif for i in range(self.n - 1)]


class BinDefinition(NamedTuple):
    thresholds: np.ndarray  # thresholds, including the top
    labels: List[str]  # friendly-formatted thresholds
    short_labels: List[str]  # shorter labels (e.g. simplified dates)
    width: Union[float, None]  # widths, if uniform; otherwise None
    width_label: str  # friendly-formatted width (e.g. '50' or '2 weeks')


# NamedTupleMeta doesn't allow to define __new__ so we need a subclass
# Name of the class has to be the same to match the namedtuple name
# pylint: disable=function-redefined
class BinDefinition(BinDefinition):
    def __new__(cls, thresholds, labels="%g",
                short_labels=None, width=None, width_label=""):

        def get_labels(fmt, default=None):
            if fmt is None:
                return default
            if isinstance(fmt, str):
                return [fmt % x for x in thresholds]
            elif isinstance(fmt, Callable):
                return [fmt(x) for x in thresholds]
            else:
                return fmt

        labels = get_labels(labels)
        short_labels = get_labels(short_labels, labels)
        if not width_label and width is not None:
            width_label = f"{width:g}"
        return super().__new__(
            cls, thresholds, labels, short_labels, width, width_label)

    @property
    def start(self) -> float:
        return self.thresholds[0]

    @property
    def nbins(self) -> int:
        return len(self.thresholds) - 1


def decimal_binnings(
        data, *, min_width=0, min_bins=2, max_bins=50,
        min_unique=5, add_unique=0,
        factors=(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20),
        label_fmt="%g"):
    """
    Find a set of nice splits of data into bins

    The function first computes the scaling factor that is, the power of 10
    that brings the interval of values within [0, 1]. For instances, if the
    numbers come from interaval 10004001 and 10007005, the width of the
    interval is 3004, so the scaling factor is 1000.

    The function next considers bin widths that are products of scaling and
    different factors from 20 to 0.01 that make sense in decimal scale
    (see default value for argument `factors`). For each width, it rounds the
    minimal value down to this width and the maximal value up, and it computes
    the number of bins of that width that fit between these two values.
    If the number of bins is between `min_bins` and `max_bins`, and the width
    is at least `min_width`, this is a valid interval.

    If the data has no more than `min_unique` unique values, the function will
    add a set of bins that put each value into its own bin.

    If the data has no more than `add_unique` values, that last bins will put
    each value into its own bin.

    Args:
        data (np.ndarray):
            vector of data points; values may repeat, and nans and infs are
            filtered out.
        min_width (float): minimal bin width
        min_bins (int): minimal number of bins
        max_bins (int):
            maximal number of bins; the number of bins will never exceed the
            number of unique values
        min_unique (int):
            if the number of unique values are less or equal to `min_unique`,
            the function returns a single binning that matches that values in
            the data
        add_unique (int):
            similar to `min_unique` except that such bins are added to the list;
            set to 0 to disable
        factors (list of float):
            The factors with which the scaling is multiplied. Default is
            `(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20)`,
            so if scaling is 1000, considered bin widths are 20000, 10000,
            5000, 2000, 1000, 500, 250, 200, 100, 50, 25, 20 and 10.
        label_fmt (str or Callable):
            A format string (default: "%g") used for threshold labels,
            or a function for formatting thresholds (e.g. var.str_val)

    Returns:
        bin_boundaries (list of np.ndarray): a list of bin boundaries,
            including the top boundary of the last interval, hence the list
            size equals the number bins + 1. These array match the `bin`
            argument of `numpy.histogram`.

            This is returned if `return_defs` is left `True`.

        bin_definition (list of BinDefinition):
            `BinDefinition` is a named tuple containing the beginning of the
            first bin (`start`), number of bins (`nbins`) and their widths
            (`width`). The last value can also be a `nd.array` with `nbins + 1`
            elements, which describes bins of unequal width and is used for
            binnings that match the unique values in the data (see `min_unique`
            and `add_unique`).

            This is returned if `return_defs` is `False`.
    """
    bins = []

    mn, mx, unique = _min_max_unique(data)
    if len(unique) <= max(min_unique, add_unique):
        bins.append(BinDefinition(_unique_thresholds(unique), label_fmt))
        if len(unique) <= min_unique:
            return bins

    diff = mx - mn
    f10 = 10 ** -np.floor(np.log10(diff))
    max_bins = min(max_bins, len(unique))
    for f in factors:
        width = f / f10
        if width < min_width:
            continue
        mn_ = np.floor(mn / width) * width
        mx_ = np.ceil(mx / width) * width
        nbins = np.round((mx_ - mn_) / width)
        if min_bins <= nbins <= max_bins \
                and (not bins or bins[-1].nbins != nbins):
            bin_def = BinDefinition(mn_ + width * np.arange(nbins + 1),
                                    label_fmt, None, width)
            bins.append(bin_def)
    return bins


def time_binnings(data, *, min_bins=2, max_bins=50, min_unique=5, add_unique=0):
    """
    Find a set of nice splits of time variable data into bins

    The function considers bin widths of

    - 1, 5, 10, 15, 30 seconds.
    - 1, 5, 10, 15, 30 minutes,
    - 1, 2, 3, 6, 12 hours,
    - 1 day,
    - 1, 2 weeks,
    - 1, 2, 3, 6 months,
    - 1, 2, 5, 10, 25, 50, 100 years,

    and returns those that yield between `min_bins` and `max_bins` intervals.

    Args:
        data (np.ndarray):
            vector of data points; values may repeat, and nans and infs are
            filtered out.
        min_bins (int): minimal number of bins
        max_bins (int):
            maximal number of bins; the number of bins will never exceed the
            number of unique values

    Returns:
        bin_boundaries (list): a list of possible binning.
            Each element of `bin_boundaries` is a tuple consisting of a label
            describing the bin size (e.g. `2 weeks`) and a list of thresholds.
            Thresholds are given as pairs
            (number_of_seconds_since_epoch, label).
    """
    mn, mx, unique = _min_max_unique(data)
    mn = utc_from_timestamp(mn).timetuple()
    mx = utc_from_timestamp(mx).timetuple()
    bins = []
    if len(unique) <= max(min_unique, add_unique):
        bins.append(_unique_time_bins(unique))
    if len(unique) > min_unique:
        bins += _time_binnings(mn, mx, min_bins + 1, max_bins + 1)
    return bins


def _time_binnings(mn, mx, min_pts, max_pts):
    bins = []
    for place, step, fmt, unit in (
            [(5, x, "%H:%M:%S", "second") for x in (1, 5, 10, 15, 30)] +
            [(4, x, "%b %d %H:%M", "minute") for x in (1, 5, 10, 15, 30)] +
            [(3, x, "%y %b %d %H:%M", "hour") for x in (1, 2, 3, 6, 12)] +
            [(2, 1, "%y %b %d", "day")] +
            [(2, x, "%y %b %d", "week") for x in (7, 14)] +
            [(1, x, "%y %b", "month") for x in (1, 2, 3, 6)] +
            [(0, x, "%Y", "year") for x in (1, 2, 5, 10, 25, 50, 100)]):
        times = _time_range(mn, mx, place, step, min_pts, max_pts)
        if not times:
            continue
        times = [time.struct_time(t + (0, 0, 0)) for t in times]
        thresholds = [calendar.timegm(t) for t in times]
        labels = [time.strftime(fmt, t) for t in times]
        short_labels = _simplified_labels(labels)
        if place == 2 and step >= 7:
            unit_label = f"{step // 7} week{'s' * (step > 7)}"
        else:
            unit_label = f"{step} {unit}{'s' * (step > 1)}"
        new_bins = BinDefinition(
            thresholds, labels, short_labels, None, unit_label)
        if not bins or new_bins.nbins != bins[-1].nbins:
            bins.append(new_bins)
    return bins


# datetime + deltatime is not very useful here because deltatime is
# given a number of days, not years or months, so it doesn't allow
# for specifying a step of 1 month
def _time_range(start, end, place, step, min_pts, max_pts,
                _zeros=(0, 1, 1, 0, 0, 0)):
    if place == 2 and step % 7 == 0:
        startd = datetime.date(*start[:3])
        startd -= datetime.timedelta(days=-startd.weekday())
        start = [startd.year, startd.month, startd.day, 0, 0, 0]
    else:
        start = list(
            start[:place]
            + ((start[place] - _zeros[place]) // step * step + _zeros[place], )
            + _zeros[place + 1:])
    end = list(end[:place + 1] + _zeros[place + 1:])
    s = [tuple(start)]
    for _ in range(max_pts - 1):
        start[place] += step
        if place >= 3:  # hours, minutes, seconds
            for pos, maxval in enumerate((60, 60, 24), start=1):
                if start[-pos] >= maxval:
                    start[-pos - 1] += 1
                    start[-pos] %= maxval
        if place >= 2:
            md = _month_days(*start[:2])
            if start[2] > md:
                start[1] += 1
                start[2] %= md
        if start[1] > 12:
            start[0] += 1
            start[1] %= 12
        s.append(tuple(start))
        if start > end:
            return s if len(s) >= min_pts else None
    return None


def _month_days(year, month,
                _md=(None, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)):
    return _md[month] + (
        month == 2 and (year % 400 == 0 or year % 4 == 0 and year % 100 != 0))


def _simplified_labels(labels):
    labels = labels[:]
    to_remove = "42"
    while True:
        firsts = {f for f, *_ in (lab.split() for lab in labels)}
        if len(firsts) > 1:
            break
        to_remove = firsts.pop()
        flen = len(to_remove)
        if any(len(lab) == flen for lab in labels):
            break
        labels = [lab[flen+1:] for lab in labels]
    for i in range(len(labels) - 1, 0, -1):
        for k, c, d in zip(count(), labels[i].split(), labels[i - 1].split()):
            if c != d:
                labels[i] = " ".join(labels[i].split()[k:])
                break
    # If the last thing removed were month names and the labels continues with
    # hours, keep month name in the first label; "08 12:29" looks awkward.
    if not to_remove[0].isdigit() and ":" in labels[0]:
        labels[0] = f"{to_remove} {labels[0]}"
    return labels


def _unique_time_bins(unique):
    times = [utc_from_timestamp(x).timetuple() for x in unique]
    fmt = f'%y %b %d'
    fmt += " %H:%M" * (len({t[2:] for t in times}) > 1)
    fmt += ":%S" * bool(np.all(unique % 60 == 0))
    labels = [time.strftime(fmt, x) for x in times]
    short_labels = _simplified_labels(labels)
    return BinDefinition(_unique_thresholds(unique), labels, short_labels)


def _unique_thresholds(unique):
    if len(unique) >= 2:
        # make the last bin the same width as the one before
        last_boundary = 2 * unique[-1] - unique[-2]
    else:
        last_boundary = unique[0] + 1
    return np.hstack((unique, [last_boundary]))


def _min_max_unique(data):
    unique = np.unique(data)
    unique = unique[np.isfinite(unique)]
    if not unique.size:
        raise ValueError("no valid (non-nan) data")
    return unique[0], unique[-1], unique


short_time_units = dict(seconds="sec", minutes="min", hours="hrs",
                        weeks="wks", months="mon", years="yrs",
                        second="sec", minute="min", month="mon")


# noinspection PyPep8Naming
class EntropyMDL(Discretization):
    """
    Discretization into bins inferred by recursively splitting the values to
    minimize the class-entropy. The procedure stops when further splits would
    decrease the entropy for less than the corresponding increase of minimal
    description length (MDL). [FayyadIrani93].

    If there are no suitable cut-off points, the procedure returns a single bin,
    which means that the new feature is constant and can be removed.

    .. attribute:: force

        Induce at least one cut-off point, even when its information
        gain is lower than MDL (default: False).

    """
    def __init__(self, force=False):
        self.force = force

    def __call__(self, data, attribute):
        cont = contingency.get_contingency(data, attribute)
        values, I = cont.values, cont.counts.T
        cut_ind = np.array(self._entropy_discretize_sorted(I, self.force))
        if len(cut_ind) > 0:
            # "the midpoint between each successive pair of examples" (FI p.1)
            points = (values[cut_ind] + values[cut_ind - 1]) / 2.
        else:
            points = []
        return Discretizer.create_discretized_var(
            data.domain[attribute], points)

    @classmethod
    def _normalize(cls, X, axis=None, out=None):
        """
        Normalize `X` array so it sums to 1.0 over the `axis`.

        Parameters
        ----------
        X : array
            Array to normalize.
        axis : optional int
            Axis over which the resulting array sums to 1.
        out : optional array
            Output array of the same shape as X.
        """
        X = np.asarray(X, dtype=float)
        scale = np.sum(X, axis=axis, keepdims=True)
        if out is None:
            return X / scale
        else:
            if out is not X:
                assert out.shape == X.shape
                out[:] = X
            out /= scale
            return out

    @classmethod
    def _entropy_normalized(cls, D, axis=None):
        """
        Compute the entropy of distribution array `D`.

        `D` must be a distribution (i.e. sum to 1.0 over `axis`)

        Parameters
        ----------
        D : array
            Distribution.
        axis : optional int
            Axis of `D` along which to compute the entropy.

        """
        # req: (np.sum(D, axis=axis) >= 0).all()
        # req: (np.sum(D, axis=axis) <= 1).all()
        # req: np.all(np.abs(np.sum(D, axis=axis) - 1) < 1e-9)

        D = np.asarray(D)
        Dc = np.clip(D, np.finfo(D.dtype).eps, 1.0)
        return - np.sum(D * np.log2(Dc), axis=axis)

    @classmethod
    def _entropy(cls, D, axis=None):
        """
        Compute the entropy of distribution `D`.

        Parameters
        ----------
        D : array
            Distribution.
        axis : optional int
            Axis of `D` along which to compute the entropy.

        """
        D = cls._normalize(D, axis=axis)
        return cls._entropy_normalized(D, axis=axis)

    @classmethod
    def _entropy1(cls, D):
        """
        Compute the entropy of distributions in `D`
        (one per each row).
        """
        D = cls._normalize(D)
        return _discretize.entropy_normalized1(D)

    @classmethod
    def _entropy2(cls, D):
        """
        Compute the entropy of distributions in `D`
        (one per each row).
        """
        D = cls._normalize(D, axis=1)
        return _discretize.entropy_normalized2(D)

    @classmethod
    def _entropy_cuts_sorted(cls, CS):
        """
        Return the class information entropy induced by partitioning
        the `CS` distribution at all N-1 candidate cut points.

        Parameters
        ----------
        CS : (N, K) array of class distributions.
        """
        CS = np.asarray(CS)
        # |--|-------|--------|
        #  S1    ^       S2
        # S1 contains all points which are <= to cut point
        # Cumulative distributions for S1 and S2 (left right set)
        # i.e. a cut at index i separates the CS into S1Dist[i] and S2Dist[i]
        S1Dist = np.cumsum(CS, axis=0)[:-1]
        S2Dist = np.cumsum(CS[::-1], axis=0)[-2::-1]

        # Entropy of S1[i] and S2[i] sets
        ES1 = cls._entropy2(S1Dist)
        ES2 = cls._entropy2(S2Dist)

        # Number of cases in S1[i] and S2[i] sets
        S1_count = np.sum(S1Dist, axis=1)
        S2_count = np.sum(S2Dist, axis=1)

        # Number of all cases
        S_count = np.sum(CS)

        ES1w = ES1 * S1_count / S_count
        ES2w = ES2 * S2_count / S_count

        # E(A, T; S) Class information entropy of the partition S
        E = ES1w + ES2w

        return E, ES1, ES2

    @classmethod
    def _entropy_discretize_sorted(cls, C, force=False):
        """
        Entropy discretization on a sorted C.

        :param C: (N, K) array of class distributions.

        """
        E, ES1, ES2 = cls._entropy_cuts_sorted(C)
        # TODO: Also get the left right distribution counts from
        # entropy_cuts_sorted,

        # Note the + 1
        if len(E) == 0:
            return []
        cut_index = np.argmin(E) + 1

        # Distribution of classed in S1, S2 and S
        S1_c = np.sum(C[:cut_index], axis=0)
        S2_c = np.sum(C[cut_index:], axis=0)
        S_c = S1_c + S2_c

        ES = cls._entropy1(np.sum(C, axis=0))
        ES1, ES2 = ES1[cut_index - 1], ES2[cut_index - 1]

        # Information gain of the best split
        Gain = ES - E[cut_index - 1]
        # Number of different classes in S, S1 and S2
        k = float(np.sum(S_c > 0))
        k1 = float(np.sum(S1_c > 0))
        k2 = float(np.sum(S2_c > 0))

        assert k > 0
        delta = np.log2(3 ** k - 2) - (k * ES - k1 * ES1 - k2 * ES2)
        N = float(np.sum(S_c))

        if N > 1 and Gain > np.log2(N - 1) / N + delta / N:
            # Accept the cut point and recursively split the subsets.
            left, right = [], []
            if k1 > 1 and cut_index > 1:
                left = cls._entropy_discretize_sorted(C[:cut_index, :])
            if k2 > 1 and cut_index < len(C) - 1:
                right = cls._entropy_discretize_sorted(C[cut_index:, :])
            return left + [cut_index] + [i + cut_index for i in right]
        elif force:
            return [cut_index]
        else:
            return []


class DomainDiscretizer(Reprable):
    """Discretizes all continuous features in the data.

    .. attribute:: method

        Feature discretization method (instance of
        :obj:`Orange.preprocess.Discretization`). If `None` (default),
        :class:`Orange.preprocess.EqualFreq` with 4 intervals is
        used.

    .. attribute:: clean

        If `True`, features discretized into a single interval constant are
        removed. This is useful for discretization methods that infer the
        number of intervals from the data, such as
        :class:`Orange.preprocess.EntropyMDL` (default: `True`).

    .. attribute:: discretize_class

        Determines whether a target is also discretized if it is continuous.
        (default: `False`)
    """
    def __init__(self, discretize_class=False, method=None, clean=True,
                 fixed=None):
        self.discretize_class = discretize_class
        self.method = method
        self.clean = clean
        self.fixed = fixed

    def __call__(self, data, fixed=None):
        """
        Compute and return discretized domain.

        :param data: Data to discretize.
        """

        def transform_list(s, fixed=None):
            new_vars = []
            for var in s:
                if var.is_continuous:
                    if fixed and var.name in fixed.keys():
                        nv = method(data, var, fixed)
                    else:
                        nv = method(data, var)
                    if not self.clean or len(nv.values) > 1:
                        new_vars.append(nv)
                else:
                    new_vars.append(var)
            return new_vars
        if self.method is None:
            method = EqualFreq(n=4)
        else:
            method = self.method
        domain = data.domain
        new_attrs = transform_list(domain.attributes, fixed or self.fixed)
        if self.discretize_class:
            new_classes = transform_list(domain.class_vars)
        else:
            new_classes = domain.class_vars
        return Domain(new_attrs, new_classes)

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
[ISSUE]
**Title:** Edge Values Assigned to Incorrect Bins Due to Floating Point Precision

**Description:**
When discretizing decimal values, values that lie exactly on the edge of a bin are sometimes assigned to the wrong bin. This issue seems to be caused by floating point precision errors in the binning thresholds, leading to incorrect bin assignments.

**Example:**
Consider the following code snippet used for binning decimal values:

```python
import numpy as np
from Orange.preprocess import decimal_binnings

values = np.array([
    -0.2, -0.2, -0.6, 1.0, 0.2, -0.6, 0.6, 1.0, 0.4, -0.5, -0.4, -0.4,
    -0.6, 0.6, 0.75, 0.4, -0.2, 0.2, 0.0, 0.0, -1.0, -0.6, -0.2, -0.6,
])
binning = decimal_binnings(values, factors=[0.2, 0.25, 0.5])
```

**Expected Behavior:**
The binning function should create precise bin thresholds so that values exactly on the edge fall into the correct bin. For example, with a bin width of 0.2, the thresholds should be `[-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1]`. This ensures that a value of `0.2` is correctly placed in its intended bin without falling into an adjacent bin due to precision errors.

**Actual Behavior:**
Due to floating point precision errors, the binning thresholds may have minor inaccuracies. This results in values that lie exactly on the bin edges, such as `0.2`, being assigned to the wrong bin. The discrepancies caused by these precision errors lead to failing tests that expect the binning thresholds to match exactly, even though they appear identical at a glance.

[/ISSUE]
{
    "TestEqualFreq.test_below_precision": "PASSED",
    "TestEqualFreq.test_equifreq_100_to_4": "PASSED",
    "TestEqualFreq.test_equifreq_with_k_instances": "PASSED",
    "TestEqualFreq.test_equifreq_with_too_few_values": "PASSED",
    "TestEqualWidth.test_equalwidth_100_to_4": "PASSED",
    "TestEqualWidth.test_equalwidth_const_value": "PASSED",
    "TestEqualWidth.test_equalwidth_on_two_values": "PASSED",
    "TestBinning.test_decimal_binnings": "PASSED",
    "TestEntropyMDL.test_entropy": "PASSED",
    "TestEntropyMDL.test_entropy_constant": "PASSED",
    "TestEntropyMDL.test_entropy_with_two_values": "PASSED",
    "TestEntropyMDL.test_entropy_with_two_values_useless": "PASSED",
    "TestDiscretizer.test_create_discretized_var": "PASSED",
    "TestDiscretizer.test_create_discretized_var_formatting": "PASSED",
    "TestDiscretizer.test_discretize_class": "PASSED",
    "TestDiscretizer.test_discretize_metas": "PASSED",
    "TestDiscretizer.test_discretizer_computation": "PASSED",
    "TestDiscretizer.test_discretizer_computation_sparse": "PASSED",
    "TestDiscretizer.test_discretizer_computation_sparse_no_points": "PASSED",
    "TestDiscretizer.test_keep_constant": "PASSED",
    "TestDiscretizer.test_remove_constant": "PASSED",
    "TestDiscretizer.test_transform": "PASSED",
    "TestDiscretizeTable.test_discretize_class": "PASSED",
    "TestDiscretizeTable.test_discretize_exclude_constant": "PASSED",
    "TestDiscretizeTable.test_fixed": "PASSED",
    "TestDiscretizeTable.test_leave_discrete": "PASSED",
    "TestDiscretizeTable.test_method": "PASSED",
    "TestInstanceConversion.test_single_instance": "PASSED"
}
diff --git a/Orange/preprocess/discretize.py b/Orange/preprocess/discretize.py
index f16a3f812..1502b97f0 100644
--- a/Orange/preprocess/discretize.py
+++ b/Orange/preprocess/discretize.py
@@ -320,8 +320,11 @@ def decimal_binnings(
         nbins = np.round((mx_ - mn_) / width)
         if min_bins <= nbins <= max_bins \
                 and (not bins or bins[-1].nbins != nbins):
-            bin_def = BinDefinition(mn_ + width * np.arange(nbins + 1),
-                                    label_fmt, None, width)
+            bins_ = mn_ + width * np.arange(nbins + 1)
+            # to prevent values on the edge of the bin fall in the wrong bin
+            # due to precision error on decimals that are not precise
+            bins_ = np.around(bins_, decimals=np.finfo(bins_.dtype).precision)
+            bin_def = BinDefinition(bins_, label_fmt, None, width)
             bins.append(bin_def)
     return bins
 

{"Orange/preprocess/discretize.py": "import calendar\nimport re\nimport time\nfrom typing import NamedTuple, List, Union, Callable\nimport datetime\nfrom itertools import count\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom Orange.data import DiscreteVariable, Domain\nfrom Orange.data.sql.table import SqlTable\nfrom Orange.statistics import distribution, contingency, util as ut\nfrom Orange.statistics.basic_stats import BasicStats\nfrom Orange.util import Reprable, utc_from_timestamp\nfrom .transformation import Transformation\nfrom . import _discretize\n\n__all__ = [\"EqualFreq\", \"EqualWidth\", \"EntropyMDL\", \"DomainDiscretizer\",\n           \"decimal_binnings\", \"time_binnings\", \"short_time_units\",\n           \"BinDefinition\"]\n\n\nclass Discretizer(Transformation):\n    \"\"\"Value transformer that returns an index of the bin for the given value.\n    \"\"\"\n    def __init__(self, variable, points):\n        super().__init__(variable)\n        self.points = points\n\n    @staticmethod\n    def digitize(x, bins):\n        if sp.issparse(x):\n            if len(bins):\n                x.data = np.digitize(x.data, bins)\n            else:\n                x = sp.csr_matrix(x.shape)\n            return x\n        else:\n            return np.digitize(x, bins) if len(bins) else [0]*len(x)\n\n    def transform(self, c):\n        if sp.issparse(c):\n            return self.digitize(c, self.points)\n        elif c.size:\n            return np.where(np.isnan(c), np.NaN, self.digitize(c, self.points))\n        else:\n            return np.array([], dtype=int)\n\n    @staticmethod\n    def _fmt_interval(low, high, formatter):\n        assert low is not None or high is not None\n        assert low is None or high is None or low < high\n        if low is None or np.isinf(low):\n            return f\"< {formatter(high)}\"\n        if high is None or np.isinf(high):\n            return f\"\u2265 {formatter(low)}\"\n        return f\"{formatter(low)} - {formatter(high)}\"\n\n    @classmethod\n    def create_discretized_var(cls, var, points):\n        def fmt(val):\n            sval = var.str_val(val)\n            # For decimal numbers, remove trailing 0's and . if no decimals left\n            if re.match(r\"^\\d+\\.\\d+\", sval):\n                return sval.rstrip(\"0\").rstrip(\".\")\n            return sval\n\n        lpoints = list(points)\n        if lpoints:\n            values = [\n                cls._fmt_interval(low, high, fmt)\n                for low, high in zip([-np.inf] + lpoints, lpoints + [np.inf])]\n            to_sql = BinSql(var, lpoints)\n        else:\n            values = [\"single_value\"]\n            to_sql = SingleValueSql(values[0])\n\n        dvar = DiscreteVariable(name=var.name, values=values,\n                                compute_value=cls(var, points),\n                                sparse=var.sparse)\n        dvar.source_variable = var\n        dvar.to_sql = to_sql\n        return dvar\n\n    def __eq__(self, other):\n        return super().__eq__(other) and self.points == other.points\n\n    def __hash__(self):\n        return hash((type(self), self.variable, tuple(self.points)))\n\n\nclass BinSql:\n    def __init__(self, var, points):\n        self.var = var\n        self.points = points\n\n    def __call__(self):\n        return 'width_bucket(%s, ARRAY%s::double precision[])' % (\n            self.var.to_sql(), str(self.points))\n\n\nclass SingleValueSql:\n    def __init__(self, value):\n        self.value = value\n\n    def __call__(self):\n        return \"'%s'\" % self.value\n\n\nclass Discretization(Reprable):\n    \"\"\"Abstract base class for discretization classes.\"\"\"\n    def __call__(self, data, variable):\n        \"\"\"\n        Compute discretization of the given variable on the given data.\n        Return a new variable with the appropriate domain\n        (:obj:`Orange.data.DiscreteVariable.values`) and transformer\n        (:obj:`Orange.data.Variable.compute_value`).\n        \"\"\"\n        raise NotImplementedError(\n            \"Subclasses of 'Discretization' need to implement \"\n            \"the call operator\")\n\n\nclass EqualFreq(Discretization):\n    \"\"\"Discretization into bins with approximately equal number of data\n    instances.\n\n    .. attribute:: n\n\n        Number of bins (default: 4). The actual number may be lower if the\n        variable has less than n distinct values.\n    \"\"\"\n    def __init__(self, n=4):\n        self.n = n\n\n    # noinspection PyProtectedMember\n    def __call__(self, data, attribute):\n        if type(data) == SqlTable:\n            att = attribute.to_sql()\n            quantiles = [(i + 1) / self.n for i in range(self.n - 1)]\n            query = data._sql_query(\n                ['quantile(%s, ARRAY%s)' % (att, str(quantiles))],\n                use_time_sample=1000)\n            with data._execute_sql_query(query) as cur:\n                points = sorted(set(cur.fetchone()[0]))\n        else:\n            d = distribution.get_distribution(data, attribute)\n            points = _discretize.split_eq_freq(d, self.n)\n            # np.unique handles cases in which differences are below precision\n            points = list(np.unique(points))\n        return Discretizer.create_discretized_var(\n            data.domain[attribute], points)\n\nclass EqualWidth(Discretization):\n    \"\"\"Discretization into a fixed number of bins with equal widths.\n\n    .. attribute:: n\n\n        Number of bins (default: 4).\n    \"\"\"\n    def __init__(self, n=4):\n        self.n = n\n\n    # noinspection PyProtectedMember\n    def __call__(self, data, attribute, fixed=None):\n        if fixed:\n            min, max = fixed[attribute.name]\n            points = self._split_eq_width(min, max)\n        else:\n            if type(data) == SqlTable:\n                stats = BasicStats(data, attribute)\n                points = self._split_eq_width(stats.min, stats.max)\n            else:\n                values = data[:, attribute]\n                values = values.X if values.X.size else values.Y\n                if values.size:\n                    min, max = ut.nanmin(values), ut.nanmax(values)\n                    points = self._split_eq_width(min, max)\n                else:\n                    points = []\n        return Discretizer.create_discretized_var(\n            data.domain[attribute], points)\n\n    def _split_eq_width(self, min, max):\n        if np.isnan(min) or np.isnan(max) or min == max:\n            return []\n        dif = (max - min) / self.n\n        return [min + (i + 1) * dif for i in range(self.n - 1)]\n\n\nclass BinDefinition(NamedTuple):\n    thresholds: np.ndarray  # thresholds, including the top\n    labels: List[str]  # friendly-formatted thresholds\n    short_labels: List[str]  # shorter labels (e.g. simplified dates)\n    width: Union[float, None]  # widths, if uniform; otherwise None\n    width_label: str  # friendly-formatted width (e.g. '50' or '2 weeks')\n\n\n# NamedTupleMeta doesn't allow to define __new__ so we need a subclass\n# Name of the class has to be the same to match the namedtuple name\n# pylint: disable=function-redefined\nclass BinDefinition(BinDefinition):\n    def __new__(cls, thresholds, labels=\"%g\",\n                short_labels=None, width=None, width_label=\"\"):\n\n        def get_labels(fmt, default=None):\n            if fmt is None:\n                return default\n            if isinstance(fmt, str):\n                return [fmt % x for x in thresholds]\n            elif isinstance(fmt, Callable):\n                return [fmt(x) for x in thresholds]\n            else:\n                return fmt\n\n        labels = get_labels(labels)\n        short_labels = get_labels(short_labels, labels)\n        if not width_label and width is not None:\n            width_label = f\"{width:g}\"\n        return super().__new__(\n            cls, thresholds, labels, short_labels, width, width_label)\n\n    @property\n    def start(self) -> float:\n        return self.thresholds[0]\n\n    @property\n    def nbins(self) -> int:\n        return len(self.thresholds) - 1\n\n\ndef decimal_binnings(\n        data, *, min_width=0, min_bins=2, max_bins=50,\n        min_unique=5, add_unique=0,\n        factors=(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20),\n        label_fmt=\"%g\"):\n    \"\"\"\n    Find a set of nice splits of data into bins\n\n    The function first computes the scaling factor that is, the power of 10\n    that brings the interval of values within [0, 1]. For instances, if the\n    numbers come from interaval 10004001 and 10007005, the width of the\n    interval is 3004, so the scaling factor is 1000.\n\n    The function next considers bin widths that are products of scaling and\n    different factors from 20 to 0.01 that make sense in decimal scale\n    (see default value for argument `factors`). For each width, it rounds the\n    minimal value down to this width and the maximal value up, and it computes\n    the number of bins of that width that fit between these two values.\n    If the number of bins is between `min_bins` and `max_bins`, and the width\n    is at least `min_width`, this is a valid interval.\n\n    If the data has no more than `min_unique` unique values, the function will\n    add a set of bins that put each value into its own bin.\n\n    If the data has no more than `add_unique` values, that last bins will put\n    each value into its own bin.\n\n    Args:\n        data (np.ndarray):\n            vector of data points; values may repeat, and nans and infs are\n            filtered out.\n        min_width (float): minimal bin width\n        min_bins (int): minimal number of bins\n        max_bins (int):\n            maximal number of bins; the number of bins will never exceed the\n            number of unique values\n        min_unique (int):\n            if the number of unique values are less or equal to `min_unique`,\n            the function returns a single binning that matches that values in\n            the data\n        add_unique (int):\n            similar to `min_unique` except that such bins are added to the list;\n            set to 0 to disable\n        factors (list of float):\n            The factors with which the scaling is multiplied. Default is\n            `(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20)`,\n            so if scaling is 1000, considered bin widths are 20000, 10000,\n            5000, 2000, 1000, 500, 250, 200, 100, 50, 25, 20 and 10.\n        label_fmt (str or Callable):\n            A format string (default: \"%g\") used for threshold labels,\n            or a function for formatting thresholds (e.g. var.str_val)\n\n    Returns:\n        bin_boundaries (list of np.ndarray): a list of bin boundaries,\n            including the top boundary of the last interval, hence the list\n            size equals the number bins + 1. These array match the `bin`\n            argument of `numpy.histogram`.\n\n            This is returned if `return_defs` is left `True`.\n\n        bin_definition (list of BinDefinition):\n            `BinDefinition` is a named tuple containing the beginning of the\n            first bin (`start`), number of bins (`nbins`) and their widths\n            (`width`). The last value can also be a `nd.array` with `nbins + 1`\n            elements, which describes bins of unequal width and is used for\n            binnings that match the unique values in the data (see `min_unique`\n            and `add_unique`).\n\n            This is returned if `return_defs` is `False`.\n    \"\"\"\n    bins = []\n\n    mn, mx, unique = _min_max_unique(data)\n    if len(unique) <= max(min_unique, add_unique):\n        bins.append(BinDefinition(_unique_thresholds(unique), label_fmt))\n        if len(unique) <= min_unique:\n            return bins\n\n    diff = mx - mn\n    f10 = 10 ** -np.floor(np.log10(diff))\n    max_bins = min(max_bins, len(unique))\n    for f in factors:\n        width = f / f10\n        if width < min_width:\n            continue\n        mn_ = np.floor(mn / width) * width\n        mx_ = np.ceil(mx / width) * width\n        nbins = np.round((mx_ - mn_) / width)\n        if min_bins <= nbins <= max_bins \\\n                and (not bins or bins[-1].nbins != nbins):\n            bin_def = BinDefinition(mn_ + width * np.arange(nbins + 1),\n                                    label_fmt, None, width)\n            bins.append(bin_def)\n    return bins\n\n\ndef time_binnings(data, *, min_bins=2, max_bins=50, min_unique=5, add_unique=0):\n    \"\"\"\n    Find a set of nice splits of time variable data into bins\n\n    The function considers bin widths of\n\n    - 1, 5, 10, 15, 30 seconds.\n    - 1, 5, 10, 15, 30 minutes,\n    - 1, 2, 3, 6, 12 hours,\n    - 1 day,\n    - 1, 2 weeks,\n    - 1, 2, 3, 6 months,\n    - 1, 2, 5, 10, 25, 50, 100 years,\n\n    and returns those that yield between `min_bins` and `max_bins` intervals.\n\n    Args:\n        data (np.ndarray):\n            vector of data points; values may repeat, and nans and infs are\n            filtered out.\n        min_bins (int): minimal number of bins\n        max_bins (int):\n            maximal number of bins; the number of bins will never exceed the\n            number of unique values\n\n    Returns:\n        bin_boundaries (list): a list of possible binning.\n            Each element of `bin_boundaries` is a tuple consisting of a label\n            describing the bin size (e.g. `2 weeks`) and a list of thresholds.\n            Thresholds are given as pairs\n            (number_of_seconds_since_epoch, label).\n    \"\"\"\n    mn, mx, unique = _min_max_unique(data)\n    mn = utc_from_timestamp(mn).timetuple()\n    mx = utc_from_timestamp(mx).timetuple()\n    bins = []\n    if len(unique) <= max(min_unique, add_unique):\n        bins.append(_unique_time_bins(unique))\n    if len(unique) > min_unique:\n        bins += _time_binnings(mn, mx, min_bins + 1, max_bins + 1)\n    return bins\n\n\ndef _time_binnings(mn, mx, min_pts, max_pts):\n    bins = []\n    for place, step, fmt, unit in (\n            [(5, x, \"%H:%M:%S\", \"second\") for x in (1, 5, 10, 15, 30)] +\n            [(4, x, \"%b %d %H:%M\", \"minute\") for x in (1, 5, 10, 15, 30)] +\n            [(3, x, \"%y %b %d %H:%M\", \"hour\") for x in (1, 2, 3, 6, 12)] +\n            [(2, 1, \"%y %b %d\", \"day\")] +\n            [(2, x, \"%y %b %d\", \"week\") for x in (7, 14)] +\n            [(1, x, \"%y %b\", \"month\") for x in (1, 2, 3, 6)] +\n            [(0, x, \"%Y\", \"year\") for x in (1, 2, 5, 10, 25, 50, 100)]):\n        times = _time_range(mn, mx, place, step, min_pts, max_pts)\n        if not times:\n            continue\n        times = [time.struct_time(t + (0, 0, 0)) for t in times]\n        thresholds = [calendar.timegm(t) for t in times]\n        labels = [time.strftime(fmt, t) for t in times]\n        short_labels = _simplified_labels(labels)\n        if place == 2 and step >= 7:\n            unit_label = f\"{step // 7} week{'s' * (step > 7)}\"\n        else:\n            unit_label = f\"{step} {unit}{'s' * (step > 1)}\"\n        new_bins = BinDefinition(\n            thresholds, labels, short_labels, None, unit_label)\n        if not bins or new_bins.nbins != bins[-1].nbins:\n            bins.append(new_bins)\n    return bins\n\n\n# datetime + deltatime is not very useful here because deltatime is\n# given a number of days, not years or months, so it doesn't allow\n# for specifying a step of 1 month\ndef _time_range(start, end, place, step, min_pts, max_pts,\n                _zeros=(0, 1, 1, 0, 0, 0)):\n    if place == 2 and step % 7 == 0:\n        startd = datetime.date(*start[:3])\n        startd -= datetime.timedelta(days=-startd.weekday())\n        start = [startd.year, startd.month, startd.day, 0, 0, 0]\n    else:\n        start = list(\n            start[:place]\n            + ((start[place] - _zeros[place]) // step * step + _zeros[place], )\n            + _zeros[place + 1:])\n    end = list(end[:place + 1] + _zeros[place + 1:])\n    s = [tuple(start)]\n    for _ in range(max_pts - 1):\n        start[place] += step\n        if place >= 3:  # hours, minutes, seconds\n            for pos, maxval in enumerate((60, 60, 24), start=1):\n                if start[-pos] >= maxval:\n                    start[-pos - 1] += 1\n                    start[-pos] %= maxval\n        if place >= 2:\n            md = _month_days(*start[:2])\n            if start[2] > md:\n                start[1] += 1\n                start[2] %= md\n        if start[1] > 12:\n            start[0] += 1\n            start[1] %= 12\n        s.append(tuple(start))\n        if start > end:\n            return s if len(s) >= min_pts else None\n    return None\n\n\ndef _month_days(year, month,\n                _md=(None, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)):\n    return _md[month] + (\n        month == 2 and (year % 400 == 0 or year % 4 == 0 and year % 100 != 0))\n\n\ndef _simplified_labels(labels):\n    labels = labels[:]\n    to_remove = \"42\"\n    while True:\n        firsts = {f for f, *_ in (lab.split() for lab in labels)}\n        if len(firsts) > 1:\n            break\n        to_remove = firsts.pop()\n        flen = len(to_remove)\n        if any(len(lab) == flen for lab in labels):\n            break\n        labels = [lab[flen+1:] for lab in labels]\n    for i in range(len(labels) - 1, 0, -1):\n        for k, c, d in zip(count(), labels[i].split(), labels[i - 1].split()):\n            if c != d:\n                labels[i] = \" \".join(labels[i].split()[k:])\n                break\n    # If the last thing removed were month names and the labels continues with\n    # hours, keep month name in the first label; \"08 12:29\" looks awkward.\n    if not to_remove[0].isdigit() and \":\" in labels[0]:\n        labels[0] = f\"{to_remove} {labels[0]}\"\n    return labels\n\n\ndef _unique_time_bins(unique):\n    times = [utc_from_timestamp(x).timetuple() for x in unique]\n    fmt = f'%y %b %d'\n    fmt += \" %H:%M\" * (len({t[2:] for t in times}) > 1)\n    fmt += \":%S\" * bool(np.all(unique % 60 == 0))\n    labels = [time.strftime(fmt, x) for x in times]\n    short_labels = _simplified_labels(labels)\n    return BinDefinition(_unique_thresholds(unique), labels, short_labels)\n\n\ndef _unique_thresholds(unique):\n    if len(unique) >= 2:\n        # make the last bin the same width as the one before\n        last_boundary = 2 * unique[-1] - unique[-2]\n    else:\n        last_boundary = unique[0] + 1\n    return np.hstack((unique, [last_boundary]))\n\n\ndef _min_max_unique(data):\n    unique = np.unique(data)\n    unique = unique[np.isfinite(unique)]\n    if not unique.size:\n        raise ValueError(\"no valid (non-nan) data\")\n    return unique[0], unique[-1], unique\n\n\nshort_time_units = dict(seconds=\"sec\", minutes=\"min\", hours=\"hrs\",\n                        weeks=\"wks\", months=\"mon\", years=\"yrs\",\n                        second=\"sec\", minute=\"min\", month=\"mon\")\n\n\n# noinspection PyPep8Naming\nclass EntropyMDL(Discretization):\n    \"\"\"\n    Discretization into bins inferred by recursively splitting the values to\n    minimize the class-entropy. The procedure stops when further splits would\n    decrease the entropy for less than the corresponding increase of minimal\n    description length (MDL). [FayyadIrani93].\n\n    If there are no suitable cut-off points, the procedure returns a single bin,\n    which means that the new feature is constant and can be removed.\n\n    .. attribute:: force\n\n        Induce at least one cut-off point, even when its information\n        gain is lower than MDL (default: False).\n\n    \"\"\"\n    def __init__(self, force=False):\n        self.force = force\n\n    def __call__(self, data, attribute):\n        cont = contingency.get_contingency(data, attribute)\n        values, I = cont.values, cont.counts.T\n        cut_ind = np.array(self._entropy_discretize_sorted(I, self.force))\n        if len(cut_ind) > 0:\n            # \"the midpoint between each successive pair of examples\" (FI p.1)\n            points = (values[cut_ind] + values[cut_ind - 1]) / 2.\n        else:\n            points = []\n        return Discretizer.create_discretized_var(\n            data.domain[attribute], points)\n\n    @classmethod\n    def _normalize(cls, X, axis=None, out=None):\n        \"\"\"\n        Normalize `X` array so it sums to 1.0 over the `axis`.\n\n        Parameters\n        ----------\n        X : array\n            Array to normalize.\n        axis : optional int\n            Axis over which the resulting array sums to 1.\n        out : optional array\n            Output array of the same shape as X.\n        \"\"\"\n        X = np.asarray(X, dtype=float)\n        scale = np.sum(X, axis=axis, keepdims=True)\n        if out is None:\n            return X / scale\n        else:\n            if out is not X:\n                assert out.shape == X.shape\n                out[:] = X\n            out /= scale\n            return out\n\n    @classmethod\n    def _entropy_normalized(cls, D, axis=None):\n        \"\"\"\n        Compute the entropy of distribution array `D`.\n\n        `D` must be a distribution (i.e. sum to 1.0 over `axis`)\n\n        Parameters\n        ----------\n        D : array\n            Distribution.\n        axis : optional int\n            Axis of `D` along which to compute the entropy.\n\n        \"\"\"\n        # req: (np.sum(D, axis=axis) >= 0).all()\n        # req: (np.sum(D, axis=axis) <= 1).all()\n        # req: np.all(np.abs(np.sum(D, axis=axis) - 1) < 1e-9)\n\n        D = np.asarray(D)\n        Dc = np.clip(D, np.finfo(D.dtype).eps, 1.0)\n        return - np.sum(D * np.log2(Dc), axis=axis)\n\n    @classmethod\n    def _entropy(cls, D, axis=None):\n        \"\"\"\n        Compute the entropy of distribution `D`.\n\n        Parameters\n        ----------\n        D : array\n            Distribution.\n        axis : optional int\n            Axis of `D` along which to compute the entropy.\n\n        \"\"\"\n        D = cls._normalize(D, axis=axis)\n        return cls._entropy_normalized(D, axis=axis)\n\n    @classmethod\n    def _entropy1(cls, D):\n        \"\"\"\n        Compute the entropy of distributions in `D`\n        (one per each row).\n        \"\"\"\n        D = cls._normalize(D)\n        return _discretize.entropy_normalized1(D)\n\n    @classmethod\n    def _entropy2(cls, D):\n        \"\"\"\n        Compute the entropy of distributions in `D`\n        (one per each row).\n        \"\"\"\n        D = cls._normalize(D, axis=1)\n        return _discretize.entropy_normalized2(D)\n\n    @classmethod\n    def _entropy_cuts_sorted(cls, CS):\n        \"\"\"\n        Return the class information entropy induced by partitioning\n        the `CS` distribution at all N-1 candidate cut points.\n\n        Parameters\n        ----------\n        CS : (N, K) array of class distributions.\n        \"\"\"\n        CS = np.asarray(CS)\n        # |--|-------|--------|\n        #  S1    ^       S2\n        # S1 contains all points which are <= to cut point\n        # Cumulative distributions for S1 and S2 (left right set)\n        # i.e. a cut at index i separates the CS into S1Dist[i] and S2Dist[i]\n        S1Dist = np.cumsum(CS, axis=0)[:-1]\n        S2Dist = np.cumsum(CS[::-1], axis=0)[-2::-1]\n\n        # Entropy of S1[i] and S2[i] sets\n        ES1 = cls._entropy2(S1Dist)\n        ES2 = cls._entropy2(S2Dist)\n\n        # Number of cases in S1[i] and S2[i] sets\n        S1_count = np.sum(S1Dist, axis=1)\n        S2_count = np.sum(S2Dist, axis=1)\n\n        # Number of all cases\n        S_count = np.sum(CS)\n\n        ES1w = ES1 * S1_count / S_count\n        ES2w = ES2 * S2_count / S_count\n\n        # E(A, T; S) Class information entropy of the partition S\n        E = ES1w + ES2w\n\n        return E, ES1, ES2\n\n    @classmethod\n    def _entropy_discretize_sorted(cls, C, force=False):\n        \"\"\"\n        Entropy discretization on a sorted C.\n\n        :param C: (N, K) array of class distributions.\n\n        \"\"\"\n        E, ES1, ES2 = cls._entropy_cuts_sorted(C)\n        # TODO: Also get the left right distribution counts from\n        # entropy_cuts_sorted,\n\n        # Note the + 1\n        if len(E) == 0:\n            return []\n        cut_index = np.argmin(E) + 1\n\n        # Distribution of classed in S1, S2 and S\n        S1_c = np.sum(C[:cut_index], axis=0)\n        S2_c = np.sum(C[cut_index:], axis=0)\n        S_c = S1_c + S2_c\n\n        ES = cls._entropy1(np.sum(C, axis=0))\n        ES1, ES2 = ES1[cut_index - 1], ES2[cut_index - 1]\n\n        # Information gain of the best split\n        Gain = ES - E[cut_index - 1]\n        # Number of different classes in S, S1 and S2\n        k = float(np.sum(S_c > 0))\n        k1 = float(np.sum(S1_c > 0))\n        k2 = float(np.sum(S2_c > 0))\n\n        assert k > 0\n        delta = np.log2(3 ** k - 2) - (k * ES - k1 * ES1 - k2 * ES2)\n        N = float(np.sum(S_c))\n\n        if N > 1 and Gain > np.log2(N - 1) / N + delta / N:\n            # Accept the cut point and recursively split the subsets.\n            left, right = [], []\n            if k1 > 1 and cut_index > 1:\n                left = cls._entropy_discretize_sorted(C[:cut_index, :])\n            if k2 > 1 and cut_index < len(C) - 1:\n                right = cls._entropy_discretize_sorted(C[cut_index:, :])\n            return left + [cut_index] + [i + cut_index for i in right]\n        elif force:\n            return [cut_index]\n        else:\n            return []\n\n\nclass DomainDiscretizer(Reprable):\n    \"\"\"Discretizes all continuous features in the data.\n\n    .. attribute:: method\n\n        Feature discretization method (instance of\n        :obj:`Orange.preprocess.Discretization`). If `None` (default),\n        :class:`Orange.preprocess.EqualFreq` with 4 intervals is\n        used.\n\n    .. attribute:: clean\n\n        If `True`, features discretized into a single interval constant are\n        removed. This is useful for discretization methods that infer the\n        number of intervals from the data, such as\n        :class:`Orange.preprocess.EntropyMDL` (default: `True`).\n\n    .. attribute:: discretize_class\n\n        Determines whether a target is also discretized if it is continuous.\n        (default: `False`)\n    \"\"\"\n    def __init__(self, discretize_class=False, method=None, clean=True,\n                 fixed=None):\n        self.discretize_class = discretize_class\n        self.method = method\n        self.clean = clean\n        self.fixed = fixed\n\n    def __call__(self, data, fixed=None):\n        \"\"\"\n        Compute and return discretized domain.\n\n        :param data: Data to discretize.\n        \"\"\"\n\n        def transform_list(s, fixed=None):\n            new_vars = []\n            for var in s:\n                if var.is_continuous:\n                    if fixed and var.name in fixed.keys():\n                        nv = method(data, var, fixed)\n                    else:\n                        nv = method(data, var)\n                    if not self.clean or len(nv.values) > 1:\n                        new_vars.append(nv)\n                else:\n                    new_vars.append(var)\n            return new_vars\n        if self.method is None:\n            method = EqualFreq(n=4)\n        else:\n            method = self.method\n        domain = data.domain\n        new_attrs = transform_list(domain.attributes, fixed or self.fixed)\n        if self.discretize_class:\n            new_classes = transform_list(domain.class_vars)\n        else:\n            new_classes = domain.class_vars\n        return Domain(new_attrs, new_classes)\n"}
A user will ask you to solve a task. You should first draft your thinking process (inner monologue). Then, generate the solution.

Your response format must follow the template below:
<think>
Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate a correct solution.
</think>
<solution>
Final solution presented to the user.
</solution>
system
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** Edge Values Assigned to Incorrect Bins Due to Floating Point Precision

**Description:**
When discretizing decimal values, values that lie exactly on the edge of a bin are sometimes assigned to the wrong bin. This issue seems to be caused by floating point precision errors in the binning thresholds, leading to incorrect bin assignments.

**Example:**
Consider the following code snippet used for binning decimal values:

```python
import numpy as np
from Orange.preprocess import decimal_binnings

values = np.array([
    -0.2, -0.2, -0.6, 1.0, 0.2, -0.6, 0.6, 1.0, 0.4, -0.5, -0.4, -0.4,
    -0.6, 0.6, 0.75, 0.4, -0.2, 0.2, 0.0, 0.0, -1.0, -0.6, -0.2, -0.6,
])
binning = decimal_binnings(values, factors=[0.2, 0.25, 0.5])
```

**Expected Behavior:**
The binning function should create precise bin thresholds so that values exactly on the edge fall into the correct bin. For example, with a bin width of 0.2, the thresholds should be `[-1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1]`. This ensures that a value of `0.2` is correctly placed in its intended bin without falling into an adjacent bin due to precision errors.

**Actual Behavior:**
Due to floating point precision errors, the binning thresholds may have minor inaccuracies. This results in values that lie exactly on the bin edges, such as `0.2`, being assigned to the wrong bin. The discrepancies caused by these precision errors lead to failing tests that expect the binning thresholds to match exactly, even though they appear identical at a glance.

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/preprocess/discretize.py
import calendar
import re
import time
from typing import NamedTuple, List, Union, Callable
import datetime
from itertools import count

import numpy as np
import scipy.sparse as sp

from Orange.data import DiscreteVariable, Domain
from Orange.data.sql.table import SqlTable
from Orange.statistics import distribution, contingency, util as ut
from Orange.statistics.basic_stats import BasicStats
from Orange.util import Reprable, utc_from_timestamp
from .transformation import Transformation
from . import _discretize

__all__ = ["EqualFreq", "EqualWidth", "EntropyMDL", "DomainDiscretizer",
           "decimal_binnings", "time_binnings", "short_time_units",
           "BinDefinition"]


class Discretizer(Transformation):
    """Value transformer that returns an index of the bin for the given value.
    """
    def __init__(self, variable, points):
        super().__init__(variable)
        self.points = points

    @staticmethod
    def digitize(x, bins):
        if sp.issparse(x):
            if len(bins):
                x.data = np.digitize(x.data, bins)
            else:
                x = sp.csr_matrix(x.shape)
            return x
        else:
            return np.digitize(x, bins) if len(bins) else [0]*len(x)

    def transform(self, c):
        if sp.issparse(c):
            return self.digitize(c, self.points)
        elif c.size:
            return np.where(np.isnan(c), np.NaN, self.digitize(c, self.points))
        else:
            return np.array([], dtype=int)

    @staticmethod
    def _fmt_interval(low, high, formatter):
        assert low is not None or high is not None
        assert low is None or high is None or low < high
        if low is None or np.isinf(low):
            return f"< {formatter(high)}"
        if high is None or np.isinf(high):
            return f"≥ {formatter(low)}"
        return f"{formatter(low)} - {formatter(high)}"

    @classmethod
    def create_discretized_var(cls, var, points):
        def fmt(val):
            sval = var.str_val(val)
            # For decimal numbers, remove trailing 0's and . if no decimals left
            if re.match(r"^\d+\.\d+", sval):
                return sval.rstrip("0").rstrip(".")
            return sval

        lpoints = list(points)
        if lpoints:
            values = [
                cls._fmt_interval(low, high, fmt)
                for low, high in zip([-np.inf] + lpoints, lpoints + [np.inf])]
            to_sql = BinSql(var, lpoints)
        else:
            values = ["single_value"]
            to_sql = SingleValueSql(values[0])

        dvar = DiscreteVariable(name=var.name, values=values,
                                compute_value=cls(var, points),
                                sparse=var.sparse)
        dvar.source_variable = var
        dvar.to_sql = to_sql
        return dvar

    def __eq__(self, other):
        return super().__eq__(other) and self.points == other.points

    def __hash__(self):
        return hash((type(self), self.variable, tuple(self.points)))


class BinSql:
    def __init__(self, var, points):
        self.var = var
        self.points = points

    def __call__(self):
        return 'width_bucket(%s, ARRAY%s::double precision[])' % (
            self.var.to_sql(), str(self.points))


class SingleValueSql:
    def __init__(self, value):
        self.value = value

    def __call__(self):
        return "'%s'" % self.value


class Discretization(Reprable):
    """Abstract base class for discretization classes."""
    def __call__(self, data, variable):
        """
        Compute discretization of the given variable on the given data.
        Return a new variable with the appropriate domain
        (:obj:`Orange.data.DiscreteVariable.values`) and transformer
        (:obj:`Orange.data.Variable.compute_value`).
        """
        raise NotImplementedError(
            "Subclasses of 'Discretization' need to implement "
            "the call operator")


class EqualFreq(Discretization):
    """Discretization into bins with approximately equal number of data
    instances.

    .. attribute:: n

        Number of bins (default: 4). The actual number may be lower if the
        variable has less than n distinct values.
    """
    def __init__(self, n=4):
        self.n = n

    # noinspection PyProtectedMember
    def __call__(self, data, attribute):
        if type(data) == SqlTable:
            att = attribute.to_sql()
            quantiles = [(i + 1) / self.n for i in range(self.n - 1)]
            query = data._sql_query(
                ['quantile(%s, ARRAY%s)' % (att, str(quantiles))],
                use_time_sample=1000)
            with data._execute_sql_query(query) as cur:
                points = sorted(set(cur.fetchone()[0]))
        else:
            d = distribution.get_distribution(data, attribute)
            points = _discretize.split_eq_freq(d, self.n)
            # np.unique handles cases in which differences are below precision
            points = list(np.unique(points))
        return Discretizer.create_discretized_var(
            data.domain[attribute], points)

class EqualWidth(Discretization):
    """Discretization into a fixed number of bins with equal widths.

    .. attribute:: n

        Number of bins (default: 4).
    """
    def __init__(self, n=4):
        self.n = n

    # noinspection PyProtectedMember
    def __call__(self, data, attribute, fixed=None):
        if fixed:
            min, max = fixed[attribute.name]
            points = self._split_eq_width(min, max)
        else:
            if type(data) == SqlTable:
                stats = BasicStats(data, attribute)
                points = self._split_eq_width(stats.min, stats.max)
            else:
                values = data[:, attribute]
                values = values.X if values.X.size else values.Y
                if values.size:
                    min, max = ut.nanmin(values), ut.nanmax(values)
                    points = self._split_eq_width(min, max)
                else:
                    points = []
        return Discretizer.create_discretized_var(
            data.domain[attribute], points)

    def _split_eq_width(self, min, max):
        if np.isnan(min) or np.isnan(max) or min == max:
            return []
        dif = (max - min) / self.n
        return [min + (i + 1) * dif for i in range(self.n - 1)]


class BinDefinition(NamedTuple):
    thresholds: np.ndarray  # thresholds, including the top
    labels: List[str]  # friendly-formatted thresholds
    short_labels: List[str]  # shorter labels (e.g. simplified dates)
    width: Union[float, None]  # widths, if uniform; otherwise None
    width_label: str  # friendly-formatted width (e.g. '50' or '2 weeks')


# NamedTupleMeta doesn't allow to define __new__ so we need a subclass
# Name of the class has to be the same to match the namedtuple name
# pylint: disable=function-redefined
class BinDefinition(BinDefinition):
    def __new__(cls, thresholds, labels="%g",
                short_labels=None, width=None, width_label=""):

        def get_labels(fmt, default=None):
            if fmt is None:
                return default
            if isinstance(fmt, str):
                return [fmt % x for x in thresholds]
            elif isinstance(fmt, Callable):
                return [fmt(x) for x in thresholds]
            else:
                return fmt

        labels = get_labels(labels)
        short_labels = get_labels(short_labels, labels)
        if not width_label and width is not None:
            width_label = f"{width:g}"
        return super().__new__(
            cls, thresholds, labels, short_labels, width, width_label)

    @property
    def start(self) -> float:
        return self.thresholds[0]

    @property
    def nbins(self) -> int:
        return len(self.thresholds) - 1


def decimal_binnings(
        data, *, min_width=0, min_bins=2, max_bins=50,
        min_unique=5, add_unique=0,
        factors=(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20),
        label_fmt="%g"):
    """
    Find a set of nice splits of data into bins

    The function first computes the scaling factor that is, the power of 10
    that brings the interval of values within [0, 1]. For instances, if the
    numbers come from interaval 10004001 and 10007005, the width of the
    interval is 3004, so the scaling factor is 1000.

    The function next considers bin widths that are products of scaling and
    different factors from 20 to 0.01 that make sense in decimal scale
    (see default value for argument `factors`). For each width, it rounds the
    minimal value down to this width and the maximal value up, and it computes
    the number of bins of that width that fit between these two values.
    If the number of bins is between `min_bins` and `max_bins`, and the width
    is at least `min_width`, this is a valid interval.

    If the data has no more than `min_unique` unique values, the function will
    add a set of bins that put each value into its own bin.

    If the data has no more than `add_unique` values, that last bins will put
    each value into its own bin.

    Args:
        data (np.ndarray):
            vector of data points; values may repeat, and nans and infs are
            filtered out.
        min_width (float): minimal bin width
        min_bins (int): minimal number of bins
        max_bins (int):
            maximal number of bins; the number of bins will never exceed the
            number of unique values
        min_unique (int):
            if the number of unique values are less or equal to `min_unique`,
            the function returns a single binning that matches that values in
            the data
        add_unique (int):
            similar to `min_unique` except that such bins are added to the list;
            set to 0 to disable
        factors (list of float):
            The factors with which the scaling is multiplied. Default is
            `(0.01, 0.02, 0.025, 0.05, 0.1, 0.2, 0.25, 0.5, 1, 2, 5, 10, 20)`,
            so if scaling is 1000, considered bin widths are 20000, 10000,
            5000, 2000, 1000, 500, 250, 200, 100, 50, 25, 20 and 10.
        label_fmt (str or Callable):
            A format string (default: "%g") used for threshold labels,
            or a function for formatting thresholds (e.g. var.str_val)

    Returns:
        bin_boundaries (list of np.ndarray): a list of bin boundaries,
            including the top boundary of the last interval, hence the list
            size equals the number bins + 1. These array match the `bin`
            argument of `numpy.histogram`.

            This is returned if `return_defs` is left `True`.

        bin_definition (list of BinDefinition):
            `BinDefinition` is a named tuple containing the beginning of the
            first bin (`start`), number of bins (`nbins`) and their widths
            (`width`). The last value can also be a `nd.array` with `nbins + 1`
            elements, which describes bins of unequal width and is used for
            binnings that match the unique values in the data (see `min_unique`
            and `add_unique`).

            This is returned if `return_defs` is `False`.
    """
    bins = []

    mn, mx, unique = _min_max_unique(data)
    if len(unique) <= max(min_unique, add_unique):
        bins.append(BinDefinition(_unique_thresholds(unique), label_fmt))
        if len(unique) <= min_unique:
            return bins

    diff = mx - mn
    f10 = 10 ** -np.floor(np.log10(diff))
    max_bins = min(max_bins, len(unique))
    for f in factors:
        width = f / f10
        if width < min_width:
            continue
        mn_ = np.floor(mn / width) * width
        mx_ = np.ceil(mx / width) * width
        nbins = np.round((mx_ - mn_) / width)
        if min_bins <= nbins <= max_bins \
                and (not bins or bins[-1].nbins != nbins):
            bin_def = BinDefinition(mn_ + width * np.arange(nbins + 1),
                                    label_fmt, None, width)
            bins.append(bin_def)
    return bins


def time_binnings(data, *, min_bins=2, max_bins=50, min_unique=5, add_unique=0):
    """
    Find a set of nice splits of time variable data into bins

    The function considers bin widths of

    - 1, 5, 10, 15, 30 seconds.
    - 1, 5, 10, 15, 30 minutes,
    - 1, 2, 3, 6, 12 hours,
    - 1 day,
    - 1, 2 weeks,
    - 1, 2, 3, 6 months,
    - 1, 2, 5, 10, 25, 50, 100 years,

    and returns those that yield between `min_bins` and `max_bins` intervals.

    Args:
        data (np.ndarray):
            vector of data points; values may repeat, and nans and infs are
            filtered out.
        min_bins (int): minimal number of bins
        max_bins (int):
            maximal number of bins; the number of bins will never exceed the
            number of unique values

    Returns:
        bin_boundaries (list): a list of possible binning.
            Each element of `bin_boundaries` is a tuple consisting of a label
            describing the bin size (e.g. `2 weeks`) and a list of thresholds.
            Thresholds are given as pairs
            (number_of_seconds_since_epoch, label).
    """
    mn, mx, unique = _min_max_unique(data)
    mn = utc_from_timestamp(mn).timetuple()
    mx = utc_from_timestamp(mx).timetuple()
    bins = []
    if len(unique) <= max(min_unique, add_unique):
        bins.append(_unique_time_bins(unique))
    if len(unique) > min_unique:
        bins += _time_binnings(mn, mx, min_bins + 1, max_bins + 1)
    return bins


def _time_binnings(mn, mx, min_pts, max_pts):
    bins = []
    for place, step, fmt, unit in (
            [(5, x, "%H:%M:%S", "second") for x in (1, 5, 10, 15, 30)] +
            [(4, x, "%b %d %H:%M", "minute") for x in (1, 5, 10, 15, 30)] +
            [(3, x, "%y %b %d %H:%M", "hour") for x in (1, 2, 3, 6, 12)] +
            [(2, 1, "%y %b %d", "day")] +
            [(2, x, "%y %b %d", "week") for x in (7, 14)] +
            [(1, x, "%y %b", "month") for x in (1, 2, 3, 6)] +
            [(0, x, "%Y", "year") for x in (1, 2, 5, 10, 25, 50, 100)]):
        times = _time_range(mn, mx, place, step, min_pts, max_pts)
        if not times:
            continue
        times = [time.struct_time(t + (0, 0, 0)) for t in times]
        thresholds = [calendar.timegm(t) for t in times]
        labels = [time.strftime(fmt, t) for t in times]
        short_labels = _simplified_labels(labels)
        if place == 2 and step >= 7:
            unit_label = f"{step // 7} week{'s' * (step > 7)}"
        else:
            unit_label = f"{step} {unit}{'s' * (step > 1)}"
        new_bins = BinDefinition(
            thresholds, labels, short_labels, None, unit_label)
        if not bins or new_bins.nbins != bins[-1].nbins:
            bins.append(new_bins)
    return bins


# datetime + deltatime is not very useful here because deltatime is
# given a number of days, not years or months, so it doesn't allow
# for specifying a step of 1 month
def _time_range(start, end, place, step, min_pts, max_pts,
                _zeros=(0, 1, 1, 0, 0, 0)):
    if place == 2 and step % 7 == 0:
        startd = datetime.date(*start[:3])
        startd -= datetime.timedelta(days=-startd.weekday())
        start = [startd.year, startd.month, startd.day, 0, 0, 0]
    else:
        start = list(
            start[:place]
            + ((start[place] - _zeros[place]) // step * step + _zeros[place], )
            + _zeros[place + 1:])
    end = list(end[:place + 1] + _zeros[place + 1:])
    s = [tuple(start)]
    for _ in range(max_pts - 1):
        start[place] += step
        if place >= 3:  # hours, minutes, seconds
            for pos, maxval in enumerate((60, 60, 24), start=1):
                if start[-pos] >= maxval:
                    start[-pos - 1] += 1
                    start[-pos] %= maxval
        if place >= 2:
            md = _month_days(*start[:2])
            if start[2] > md:
                start[1] += 1
                start[2] %= md
        if start[1] > 12:
            start[0] += 1
            start[1] %= 12
        s.append(tuple(start))
        if start > end:
            return s if len(s) >= min_pts else None
    return None


def _month_days(year, month,
                _md=(None, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)):
    return _md[month] + (
        month == 2 and (year % 400 == 0 or year % 4 == 0 and year % 100 != 0))


def _simplified_labels(labels):
    labels = labels[:]
    to_remove = "42"
    while True:
        firsts = {f for f, *_ in (lab.split() for lab in labels)}
        if len(firsts) > 1:
            break
        to_remove = firsts.pop()
        flen = len(to_remove)
        if any(len(lab) == flen for lab in labels):
            break
        labels = [lab[flen+1:] for lab in labels]
    for i in range(len(labels) - 1, 0, -1):
        for k, c, d in zip(count(), labels[i].split(), labels[i - 1].split()):
            if c != d:
                labels[i] = " ".join(labels[i].split()[k:])
                break
    # If the last thing removed were month names and the labels continues with
    # hours, keep month name in the first label; "08 12:29" looks awkward.
    if not to_remove[0].isdigit() and ":" in labels[0]:
        labels[0] = f"{to_remove} {labels[0]}"
    return labels


def _unique_time_bins(unique):
    times = [utc_from_timestamp(x).timetuple() for x in unique]
    fmt = f'%y %b %d'
    fmt += " %H:%M" * (len({t[2:] for t in times}) > 1)
    fmt += ":%S" * bool(np.all(unique % 60 == 0))
    labels = [time.strftime(fmt, x) for x in times]
    short_labels = _simplified_labels(labels)
    return BinDefinition(_unique_thresholds(unique), labels, short_labels)


def _unique_thresholds(unique):
    if len(unique) >= 2:
        # make the last bin the same width as the one before
        last_boundary = 2 * unique[-1] - unique[-2]
    else:
        last_boundary = unique[0] + 1
    return np.hstack((unique, [last_boundary]))


def _min_max_unique(data):
    unique = np.unique(data)
    unique = unique[np.isfinite(unique)]
    if not unique.size:
        raise ValueError("no valid (non-nan) data")
    return unique[0], unique[-1], unique


short_time_units = dict(seconds="sec", minutes="min", hours="hrs",
                        weeks="wks", months="mon", years="yrs",
                        second="sec", minute="min", month="mon")


# noinspection PyPep8Naming
class EntropyMDL(Discretization):
    """
    Discretization into bins inferred by recursively splitting the values to
    minimize the class-entropy. The procedure stops when further splits would
    decrease the entropy for less than the corresponding increase of minimal
    description length (MDL). [FayyadIrani93].

    If there are no suitable cut-off points, the procedure returns a single bin,
    which means that the new feature is constant and can be removed.

    .. attribute:: force

        Induce at least one cut-off point, even when its information
        gain is lower than MDL (default: False).

    """
    def __init__(self, force=False):
        self.force = force

    def __call__(self, data, attribute):
        cont = contingency.get_contingency(data, attribute)
        values, I = cont.values, cont.counts.T
        cut_ind = np.array(self._entropy_discretize_sorted(I, self.force))
        if len(cut_ind) > 0:
            # "the midpoint between each successive pair of examples" (FI p.1)
            points = (values[cut_ind] + values[cut_ind - 1]) / 2.
        else:
            points = []
        return Discretizer.create_discretized_var(
            data.domain[attribute], points)

    @classmethod
    def _normalize(cls, X, axis=None, out=None):
        """
        Normalize `X` array so it sums to 1.0 over the `axis`.

        Parameters
        ----------
        X : array
            Array to normalize.
        axis : optional int
            Axis over which the resulting array sums to 1.
        out : optional array
            Output array of the same shape as X.
        """
        X = np.asarray(X, dtype=float)
        scale = np.sum(X, axis=axis, keepdims=True)
        if out is None:
            return X / scale
        else:
            if out is not X:
                assert out.shape == X.shape
                out[:] = X
            out /= scale
            return out

    @classmethod
    def _entropy_normalized(cls, D, axis=None):
        """
        Compute the entropy of distribution array `D`.

        `D` must be a distribution (i.e. sum to 1.0 over `axis`)

        Parameters
        ----------
        D : array
            Distribution.
        axis : optional int
            Axis of `D` along which to compute the entropy.

        """
        # req: (np.sum(D, axis=axis) >= 0).all()
        # req: (np.sum(D, axis=axis) <= 1).all()
        # req: np.all(np.abs(np.sum(D, axis=axis) - 1) < 1e-9)

        D = np.asarray(D)
        Dc = np.clip(D, np.finfo(D.dtype).eps, 1.0)
        return - np.sum(D * np.log2(Dc), axis=axis)

    @classmethod
    def _entropy(cls, D, axis=None):
        """
        Compute the entropy of distribution `D`.

        Parameters
        ----------
        D : array
            Distribution.
        axis : optional int
            Axis of `D` along which to compute the entropy.

        """
        D = cls._normalize(D, axis=axis)
        return cls._entropy_normalized(D, axis=axis)

    @classmethod
    def _entropy1(cls, D):
        """
        Compute the entropy of distributions in `D`
        (one per each row).
        """
        D = cls._normalize(D)
        return _discretize.entropy_normalized1(D)

    @classmethod
    def _entropy2(cls, D):
        """
        Compute the entropy of distributions in `D`
        (one per each row).
        """
        D = cls._normalize(D, axis=1)
        return _discretize.entropy_normalized2(D)

    @classmethod
    def _entropy_cuts_sorted(cls, CS):
        """
        Return the class information entropy induced by partitioning
        the `CS` distribution at all N-1 candidate cut points.

        Parameters
        ----------
        CS : (N, K) array of class distributions.
        """
        CS = np.asarray(CS)
        # |--|-------|--------|
        #  S1    ^       S2
        # S1 contains all points which are <= to cut point
        # Cumulative distributions for S1 and S2 (left right set)
        # i.e. a cut at index i separates the CS into S1Dist[i] and S2Dist[i]
        S1Dist = np.cumsum(CS, axis=0)[:-1]
        S2Dist = np.cumsum(CS[::-1], axis=0)[-2::-1]

        # Entropy of S1[i] and S2[i] sets
        ES1 = cls._entropy2(S1Dist)
        ES2 = cls._entropy2(S2Dist)

        # Number of cases in S1[i] and S2[i] sets
        S1_count = np.sum(S1Dist, axis=1)
        S2_count = np.sum(S2Dist, axis=1)

        # Number of all cases
        S_count = np.sum(CS)

        ES1w = ES1 * S1_count / S_count
        ES2w = ES2 * S2_count / S_count

        # E(A, T; S) Class information entropy of the partition S
        E = ES1w + ES2w

        return E, ES1, ES2

    @classmethod
    def _entropy_discretize_sorted(cls, C, force=False):
        """
        Entropy discretization on a sorted C.

        :param C: (N, K) array of class distributions.

        """
        E, ES1, ES2 = cls._entropy_cuts_sorted(C)
        # TODO: Also get the left right distribution counts from
        # entropy_cuts_sorted,

        # Note the + 1
        if len(E) == 0:
            return []
        cut_index = np.argmin(E) + 1

        # Distribution of classed in S1, S2 and S
        S1_c = np.sum(C[:cut_index], axis=0)
        S2_c = np.sum(C[cut_index:], axis=0)
        S_c = S1_c + S2_c

        ES = cls._entropy1(np.sum(C, axis=0))
        ES1, ES2 = ES1[cut_index - 1], ES2[cut_index - 1]

        # Information gain of the best split
        Gain = ES - E[cut_index - 1]
        # Number of different classes in S, S1 and S2
        k = float(np.sum(S_c > 0))
        k1 = float(np.sum(S1_c > 0))
        k2 = float(np.sum(S2_c > 0))

        assert k > 0
        delta = np.log2(3 ** k - 2) - (k * ES - k1 * ES1 - k2 * ES2)
        N = float(np.sum(S_c))

        if N > 1 and Gain > np.log2(N - 1) / N + delta / N:
            # Accept the cut point and recursively split the subsets.
            left, right = [], []
            if k1 > 1 and cut_index > 1:
                left = cls._entropy_discretize_sorted(C[:cut_index, :])
            if k2 > 1 and cut_index < len(C) - 1:
                right = cls._entropy_discretize_sorted(C[cut_index:, :])
            return left + [cut_index] + [i + cut_index for i in right]
        elif force:
            return [cut_index]
        else:
            return []


class DomainDiscretizer(Reprable):
    """Discretizes all continuous features in the data.

    .. attribute:: method

        Feature discretization method (instance of
        :obj:`Orange.preprocess.Discretization`). If `None` (default),
        :class:`Orange.preprocess.EqualFreq` with 4 intervals is
        used.

    .. attribute:: clean

        If `True`, features discretized into a single interval constant are
        removed. This is useful for discretization methods that infer the
        number of intervals from the data, such as
        :class:`Orange.preprocess.EntropyMDL` (default: `True`).

    .. attribute:: discretize_class

        Determines whether a target is also discretized if it is continuous.
        (default: `False`)
    """
    def __init__(self, discretize_class=False, method=None, clean=True,
                 fixed=None):
        self.discretize_class = discretize_class
        self.method = method
        self.clean = clean
        self.fixed = fixed

    def __call__(self, data, fixed=None):
        """
        Compute and return discretized domain.

        :param data: Data to discretize.
        """

        def transform_list(s, fixed=None):
            new_vars = []
            for var in s:
                if var.is_continuous:
                    if fixed and var.name in fixed.keys():
                        nv = method(data, var, fixed)
                    else:
                        nv = method(data, var)
                    if not self.clean or len(nv.values) > 1:
                        new_vars.append(nv)
                else:
                    new_vars.append(var)
            return new_vars
        if self.method is None:
            method = EqualFreq(n=4)
        else:
            method = self.method
        domain = data.domain
        new_attrs = transform_list(domain.attributes, fixed or self.fixed)
        if self.discretize_class:
            new_classes = transform_list(domain.class_vars)
        else:
            new_classes = domain.class_vars
        return Domain(new_attrs, new_classes)

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
user