Helper method for loading old version of pickled BBox object

        :param bbox: BBox object which was incorrectly loaded with pickle
        :type bbox: sentinelhub.BBox
        :param path: Path to file where BBox object is stored
        :type path: str
        :param is_zipped: `True` if file is zipped and `False` otherwise
        :type is_zipped: bool
        :return: Correctly loaded BBox object
        :rtype: sentinelhub.BBox

def _correctly_load_bbox(bbox, path, is_zipped=False):
        """ Helper method for loading old version of pickled BBox object

        :param bbox: BBox object which was incorrectly loaded with pickle
        :type bbox: sentinelhub.BBox
        :param path: Path to file where BBox object is stored
        :type path: str
        :param is_zipped: `True` if file is zipped and `False` otherwise
        :type is_zipped: bool
        :return: Correctly loaded BBox object
        :rtype: sentinelhub.BBox
        """
        warnings.warn("Bounding box of your EOPatch is saved in old format which in the future won't be supported "
                      "anymore. Please save bounding box again, you can overwrite the existing one", DeprecationWarning,
                      stacklevel=4)

        with open(gzip.open(path) if is_zipped else path, 'rb') as pickle_file:
            crs_cnt = -1
            for _, arg, _ in pickletools.genops(pickle_file):
                if arg == 'sentinelhub.constants CRS':
                    crs_cnt = 2
                if crs_cnt == 0:
                    return sentinelhub.BBox(tuple(bbox), sentinelhub.CRS(arg))
                crs_cnt -= 1

        raise ValueError('Failed to correctly load BBox object, try downgrading sentinelhub package to <=2.4.7')