def shrink(self, src, width=<NUM_LIT:0>, max_value=<NUM_LIT:0>, filter_method=None,<EOL>path=None, flags=<NUM_LIT:0>):
if filter_method:<EOL><INDENT>get_ = _madoka.Sketch_get__<EOL>set_ = _madoka.Sketch_set__<EOL>new_sketch = Sketch(width, max_value, path, flags, src.seed)<EOL>for table_id in range(SKETCH_DEPTH):<EOL><INDENT>for offset in range(width, src.width, width):<EOL><INDENT>for cell_id in range(width):<EOL><INDENT>val = get_(src, table_id, offset + cell_id)<EOL>val = filter_method(val)<EOL>val = max_value if val > max_value else val<EOL>if val > get_(new_sketch, table_id, cell_id):<EOL><INDENT>set_(new_sketch, table_id, cell_id, val)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>self.swap(new_sketch)<EOL><DEDENT>else:<EOL><INDENT>_madoka.Sketch_shrink(self, src, width, max_value, None, path, flags)<EOL><DEDENT>
Shrink sketch
        Params:
            <Sketch> src_sketch
            <int> width
            <int> max_value
            <lambda> | <function> filter
            <str> path
            <int> flags