def _reduce_dict(count_dict, partial_key):
    L = len(partial_key)
    count = sum(v for k, v in iteritems(count_dict) if k[:L] == partial_key)
    return count
Mazify and generate in/out pairs for each connected set of shapes.
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/graphics/mosaicplot.py/_reduce_dict--crossover with--dataset/ETHPy150Open kobejohn/polymaze/polymaze/maze.py/Maze._mazify_grid