MCPcopy Create free account
hub / github.com/ActiveState/code / check_cell

Function check_cell

recipes/Python/578062_Markov/recipe-578062.py:309–317  ·  view source on GitHub ↗
(grid, block_size, word_size, index)

Source from the content-addressed store, hash-verified

307
308# compares the contents of a cell along each grid axis
309def check_cell(grid, block_size, word_size, index):
310 master = eval_index(grid, block_size, index)
311 for axis in range(word_size):
312 for value in range(block_size):
313 if index[axis] != value:
314 copy = list(index)
315 copy[axis] = value
316 slave = eval_index(grid, block_size, copy)
317 assert slave != master, 'Cell not unique along axis!'
318
319# grid
320# - grid object to be accessed and evaluated

Callers 1

build_indexFunction · 0.85

Calls 3

eval_indexFunction · 0.85
rangeFunction · 0.85
listClass · 0.85

Tested by

no test coverage detected