aa4131421419d9f2266e6a2c7d0f565cdea7c18b,mathics/builtin/image.py,ImagePartition,apply,#ImagePartition#Any#Any#Any#Any#,602

Before Change


        h = h.to_python()
        pixels = image.pixels
        shape = pixels.shape
        parts = [Image(pixels[y:y + w, x:x + w], image.color_space)
                 for x in range(0, shape[1], w) for y in range(0, shape[0], h)]
        return Expression("List", *parts)


// simple image filters

After Change


        parts = []
        for yi in range(shape[0] // h):
            row = []
            for xi in range(shape[1] // w):
                p = pixels[yi * h : (yi + 1) * h, xi * w : (xi + 1) * w]
                row.append(Image(p, image.color_space))
            if row:
                parts.append(row)
        return from_python(parts)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: mathics/Mathics
Commit Name: aa4131421419d9f2266e6a2c7d0f565cdea7c18b
Time: 2016-08-16
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/image.py
Class Name: ImagePartition
Method Name: apply


Project Name: sassoftware/python-dlpy
Commit Name: 3e07cdecb8d7eea947304fae062ed0e64b519052
Time: 2017-07-07
Author: leo.liu@sas.com
File Name: dl_api/images.py
Class Name: Image
Method Name: resize


Project Name: sassoftware/python-dlpy
Commit Name: 3e07cdecb8d7eea947304fae062ed0e64b519052
Time: 2017-07-07
Author: leo.liu@sas.com
File Name: dl_api/images.py
Class Name: Image
Method Name: crop