# 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
# 
# Path: testsuite/cases/cv2.py
# class Cv2TestCase(BaseTestCase):
#     def create_test_data(self):


import numpy
from .base import rpartial
from .cv2 import Cv2TestCase, cv2



class FilterCase(Cv2TestCase):
    def handle_args(self, name, kernel):
        self.name = name
        size = int(len(kernel) ** 0.5)
        kernel = numpy.asarray(kernel, numpy.float32).reshape((size, size))
        self.kernel = kernel / kernel.sum()

    def runner(self, im):

# 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
# 
# Path: testsuite/cases/cv2.py
# class Cv2TestCase(BaseTestCase):
#     def create_test_data(self):


# Path: testsuite/cases/cv2_filter.py
import numpy
from .base import rpartial
from .cv2 import Cv2TestCase, cv2




class FilterCase(Cv2TestCase):
    def handle_args(self, name, kernel):
        self.name = name
        size = int(len(kernel) ** 0.5)
        kernel = numpy.asarray(kernel, numpy.float32).reshape((size, size))
        self.kernel = kernel / kernel.sum()

    def runner(self, im):

        cv2.filter2D(im, -1, self.kernel)