def getSquareIsOccupied(pixelDictionary, x, y):
 squareValues = []
 for xStep in xrange((x - 1), (x + 2)):
  for yStep in xrange((y - 1), (y + 2)):
   stepKey = getStepKey(xStep, yStep)
   if (stepKey in pixelDictionary):
    return True
 return False

def getSquareIsOccupied ( pixelDictionary , x , y ) : squareValues = [ ] for xStep in xrange ( ( x - 1 ) , ( x + 2 ) ) : for yStep in xrange ( ( y - 1 ) , ( y + 2 ) ) : stepKey = getStepKey ( xStep , yStep ) if ( stepKey in pixelDictionary ) : return True return False
determine if a square around the x and y pixel coordinates is occupied .