def getCentreAndSpreadOffsets(spaceShape,<EOL>spreadShape,<EOL>stepSize=<NUM_LIT:1>):
from nupic.math.cross import cross<EOL>shape = spaceShape<EOL>if shape[<NUM_LIT:0>] == <NUM_LIT:1> and shape[<NUM_LIT:1>] == <NUM_LIT:1>:<EOL><INDENT>centerOffsets = [(<NUM_LIT:0>,<NUM_LIT:0>)]<EOL><DEDENT>else:<EOL><INDENT>xMin = -<NUM_LIT:1> * (shape[<NUM_LIT:1>] // <NUM_LIT:2>)<EOL>xMax = xMin + shape[<NUM_LIT:1>] - <NUM_LIT:1><EOL>xPositions = list(range(stepSize * xMin, stepSize * xMax + <NUM_LIT:1>, stepSize))<EOL>yMin = -<NUM_LIT:1> * (shape[<NUM_LIT:0>] // <NUM_LIT:2>)<EOL>yMax = yMin + shape[<NUM_LIT:0>] - <NUM_LIT:1><EOL>yPositions = list(range(stepSize * yMin, stepSize * yMax + <NUM_LIT:1>, stepSize))<EOL>centerOffsets = list(cross(yPositions, xPositions))<EOL><DEDENT>numCenterOffsets = len(centerOffsets)<EOL>print("<STR_LIT>", centerOffsets)<EOL>shape = spreadShape<EOL>if shape[<NUM_LIT:0>] == <NUM_LIT:1> and shape[<NUM_LIT:1>] == <NUM_LIT:1>:<EOL><INDENT>spreadOffsets = [(<NUM_LIT:0>,<NUM_LIT:0>)]<EOL><DEDENT>else:<EOL><INDENT>xMin = -<NUM_LIT:1> * (shape[<NUM_LIT:1>] // <NUM_LIT:2>)<EOL>xMax = xMin + shape[<NUM_LIT:1>] - <NUM_LIT:1><EOL>xPositions = list(range(stepSize * xMin, stepSize * xMax + <NUM_LIT:1>, stepSize))<EOL>yMin = -<NUM_LIT:1> * (shape[<NUM_LIT:0>] // <NUM_LIT:2>)<EOL>yMax = yMin + shape[<NUM_LIT:0>] - <NUM_LIT:1><EOL>yPositions = list(range(stepSize * yMin, stepSize * yMax + <NUM_LIT:1>, stepSize))<EOL>spreadOffsets = list(cross(yPositions, xPositions))<EOL>spreadOffsets.remove((<NUM_LIT:0>,<NUM_LIT:0>))<EOL>spreadOffsets.insert(<NUM_LIT:0>, (<NUM_LIT:0>,<NUM_LIT:0>))<EOL><DEDENT>numSpreadOffsets = len(spreadOffsets)<EOL>print("<STR_LIT>", spreadOffsets)<EOL>return centerOffsets, spreadOffsets<EOL>
Generates centre offsets and spread offsets for block-mode based training
regimes - star, cross, block.

  Parameters:
  -----------------------------------------------
  spaceShape:   The (height, width) of the 2-D space to explore. This
                sets the number of center-points.
  spreadShape:  The shape (height, width) of the area around each center-point
                to explore.
  stepSize:     The step size. How big each step is, in pixels. This controls
                *both* the spacing of the center-points within the block and the
                points we explore around each center-point
  retval:       (centreOffsets, spreadOffsets)