code: def bind(cell1, cell2, moduleDimensions):
    
    cell1Coords = np.unravel_index(cell1, moduleDimensions)
    cell2Coords = np.unravel_index(cell2, moduleDimensions)
    transformCoords = [(c2 - c1) % m
                       for c1, c2, m in itertools.izip(cell1Coords, cell2Coords,
                                                       moduleDimensions)]
    return np.ravel_multi_index(transformCoords, moduleDimensions)
docs: Return transform index for given cells.
  
    Convert to coordinate space, calculate transform, and convert back to an
    index. In coordinate space, the transform represents `C2 - C1`.