def get_scaled_cutout_basic(data_np, x1, y1, x2, y2, scale_x, scale_y,
                            interpolation='nearest'):

    if have_opencv and (interpolation != 'basic'):
        # opencv is fastest
        method = cv2_resize[interpolation]
        newdata = cv2.resize(data_np[y1:y2+1, x1:x2+1], None,
                             fx=scale_x, fy=scale_y,
                             interpolation=method)
        old_wd, old_ht = max(x2 - x1 + 1, 1), max(y2 - y1 + 1, 1)
        ht, wd = newdata.shape[:2]
        scale_x, scale_y = old_wd / float(wd), float(ht) / old_ht

    elif interpolation != 'basic':
        raise ValueError("Interpolation method not supported: '%s'" % (
            interpolation))

    else:
        view, (scale_x, scale_y) = get_scaled_cutout_basic_view(data_np.shape,
                                                                x1, y1, x2, y2,
                                                                scale_x, scale_y)
        newdata = data_np[view]

    return newdata, (scale_x, scale_y)
dataset/ETHPy150Open ejeschke/ginga/ginga/trcalc.py/get_scaled_cutout_basic/swapped operands of `/`