# Path: testsuite/cases/base.py
# def rpartial(func, *args, **keywords):
#     """
#     right partial — same as functools.partial, but pass function args first
#     """
#     def newfunc(*fargs, **fkeywords):
#         newkeywords = keywords.copy()
#         newkeywords.update(fkeywords)
#         return func(*(fargs + args), **newkeywords)
#     newfunc.func = func
#     newfunc.args = args
#     newfunc.keywords = keywords
#     return newfunc
# 
# class BaseAllocateCase(BaseTestCase):
#     def handle_args(self, mode):
#         self.mode = mode
# 
#     def readable_args(self):
#         return ['mode ' + self.mode]
# 
# class BaseSplitCase:
#     def handle_args(self, mode):
#         self.mode = mode
# 
#     def readable_args(self):
#         return ["split {}".format(self.mode)]
# 
# class BasePackCase:
#     def handle_args(self, mode):
#         self.mode = mode
# 
#     def readable_args(self):
#         return ["Pack to {}".format(self.mode)]
# 
# class BaseGetBandCase:
#     def handle_args(self, mode, band):
#         self.mode = mode
#         self.band = band
# 
#     def readable_args(self):
#         return ["get {} of {}".format(self.mode[self.band], self.mode)]
# 
# class BaseMergeCase:
#     def create_test_data(self):
#         data = super().create_test_data()
#         return [data[0].split()]
# 
#     def handle_args(self, mode):
#         self.mode = mode
# 
#     def readable_args(self):
#         return ["merge {}".format(self.mode)]
# 
# class BaseUnpackCase:
#     def handle_args(self, mode):
#         self.mode = mode
# 
#     def readable_args(self):
#         return ["Unpack from {}".format(self.mode)]
# 
# Path: testsuite/cases/pillow.py
# class PillowTestCase(BaseTestCase):
#     def create_test_data(self):
#     def resize(cls, self, size, resample=Image.NEAREST):
#     def gaussian_blur(cls, self, radius, n=3):
#     def getchannel(cls, self, channel):
#         L = math.sqrt(12.0 * float(radius) * radius / n + 1.0)


from .base import (rpartial, BaseAllocateCase, BaseSplitCase, BasePackCase,
                   BaseGetBandCase, BaseMergeCase, BaseUnpackCase)
from .pillow import Image, PillowTestCase


class AllocateCase(BaseAllocateCase):
    def runner(self):
        Image.new(self.mode, self.size)


class UnpackCase(BaseUnpackCase, PillowTestCase):
    def create_test_data(self):
        im = super().create_test_data()[0]
        return [im, im.tobytes()]

    def runner(self, im, data):
        im.frombytes(data)


class PackCase(BasePackCase, PillowTestCase):
    def runner(self, im):
        im.tobytes()



# Path: testsuite/cases/base.py
# def rpartial(func, *args, **keywords):
#     """
#     right partial — same as functools.partial, but pass function args first
#     """
#     def newfunc(*fargs, **fkeywords):
#         newkeywords = keywords.copy()
#         newkeywords.update(fkeywords)
#         return func(*(fargs + args), **newkeywords)
#     newfunc.func = func
#     newfunc.args = args
#     newfunc.keywords = keywords
#     return newfunc
# 
# class BaseAllocateCase(BaseTestCase):
#     def handle_args(self, mode):
#         self.mode = mode
# 
#     def readable_args(self):
#         return ['mode ' + self.mode]
# 
# class BaseSplitCase:
#     def handle_args(self, mode):
#         self.mode = mode
# 
#     def readable_args(self):
#         return ["split {}".format(self.mode)]
# 
# class BasePackCase:
#     def handle_args(self, mode):
#         self.mode = mode
# 
#     def readable_args(self):
#         return ["Pack to {}".format(self.mode)]
# 
# class BaseGetBandCase:
#     def handle_args(self, mode, band):
#         self.mode = mode
#         self.band = band
# 
#     def readable_args(self):
#         return ["get {} of {}".format(self.mode[self.band], self.mode)]
# 
# class BaseMergeCase:
#     def create_test_data(self):
#         data = super().create_test_data()
#         return [data[0].split()]
# 
#     def handle_args(self, mode):
#         self.mode = mode
# 
#     def readable_args(self):
#         return ["merge {}".format(self.mode)]
# 
# class BaseUnpackCase:
#     def handle_args(self, mode):
#         self.mode = mode
# 
#     def readable_args(self):
#         return ["Unpack from {}".format(self.mode)]
# 
# Path: testsuite/cases/pillow.py
# class PillowTestCase(BaseTestCase):
#     def create_test_data(self):
#     def resize(cls, self, size, resample=Image.NEAREST):
#     def gaussian_blur(cls, self, radius, n=3):
#     def getchannel(cls, self, channel):
#         L = math.sqrt(12.0 * float(radius) * radius / n + 1.0)


# Path: testsuite/cases/pillow_allocate.py
from .base import (rpartial, BaseAllocateCase, BaseSplitCase, BasePackCase,
                   BaseGetBandCase, BaseMergeCase, BaseUnpackCase)
from .pillow import Image, PillowTestCase



class AllocateCase(BaseAllocateCase):
    def runner(self):
        Image.new(self.mode, self.size)


class UnpackCase(BaseUnpackCase, PillowTestCase):
    def create_test_data(self):
        im = super().create_test_data()[0]
        return [im, im.tobytes()]

    def runner(self, im, data):
        im.frombytes(data)


class PackCase(BasePackCase, PillowTestCase):
    def runner(self, im):
        im.tobytes()



class SplitCase(BaseSplitCase, PillowTestCase):