2a1bd4c93a998d16516d82893401b346d66a95e9,imgaug/dtypes.py,,get_minimal_dtype,#Any#Any#,58

Before Change




def get_minimal_dtype(arrays, increase_itemsize_factor=1):
    input_dts = [array.dtype if not isinstance(array, np.dtype) else array
                 for array in arrays]
    promoted_dt = np.promote_types(*input_dts)
    if increase_itemsize_factor > 1:
        promoted_dt_highres = "%s%d" % (promoted_dt.kind, promoted_dt.itemsize * increase_itemsize_factor)
        try:

After Change


    // expects exactly two dtypes.
    promoted_dt = input_dts[0]
    input_dts = input_dts[1:]
    while len(input_dts) >= 1:
        promoted_dt = np.promote_types(promoted_dt, input_dts[0])
        input_dts = input_dts[1:]

    if increase_itemsize_factor > 1:
        assert isinstance(promoted_dt, np.dtype), (
            "Expected numpy.dtype output from numpy.promote_dtypes, got type "
            "%s." % (type(promoted_dt),))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: aleju/imgaug
Commit Name: 2a1bd4c93a998d16516d82893401b346d66a95e9
Time: 2019-07-19
Author: kontakt@ajung.name
File Name: imgaug/dtypes.py
Class Name:
Method Name: get_minimal_dtype


Project Name: ray-project/ray
Commit Name: 2cf4c7253ce1fd01975fcf970e52434e44f6d71f
Time: 2021-03-04
Author: ekhliang@gmail.com
File Name: python/ray/util/client/worker.py
Class Name: Worker
Method Name: get


Project Name: NifTK/NiftyNet
Commit Name: 253f50c4945b398f728ee45a6cd47abf78c84e1f
Time: 2017-08-10
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/io/image_window.py
Class Name:
Method Name: complete_partial_window_sizes