50e2092734bda427bd6e331968d2a5f221710143,nn_dataflow/Util.py,,factorize,#Any#Any#Any#,55

Before Change


    assert len(limits) >= num - 1
    limits = limits[:num-1] + [float("inf")]

    factors = np.ones(num, dtype=int)
    while True:
        // Calculate the last factor.
        factors[-1] = idivc(value, np.prod(factors[:-1]))
        if np.prod(factors) == value \
                and np.all(np.less(factors, limits)):
            yield tuple(np.copy(factors))

        // Update the first n - 1 factor combination, backwards.

After Change


        // Calculate the last factor.
        factors[-1] = idivc(value, prod(factors[:-1]))
        if prod(factors) == value \
                and all(f <= l for f, l in zip(factors, limits)):
            yield tuple(factors)

        // Update the first n - 1 factor combination, backwards.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: stanford-mast/nn_dataflow
Commit Name: 50e2092734bda427bd6e331968d2a5f221710143
Time: 2017-05-05
Author: mgao12@stanford.edu
File Name: nn_dataflow/Util.py
Class Name:
Method Name: factorize


Project Name: vatlab/SoS
Commit Name: 56466705f1365214b98b744db220d798435688ca
Time: 2017-03-30
Author: ben.bog@gmail.com
File Name: sos/jupyter/sos_step.py
Class Name: Interactive_Step_Executor
Method Name: pending_tasks


Project Name: pymc-devs/pymc3
Commit Name: 9a8f5127d38037de5d56ba2279fbaff6d8374960
Time: 2018-06-17
Author: colcarroll@gmail.com
File Name: pymc3/distributions/distribution.py
Class Name:
Method Name: _draw_value