parameters: (self, x, y, width, height)
return_statement: return None
docstring: returns None if at x,y,width,height no object occupies that rectangle,
              otherwise returns lower right corner of object that occupies given x,y position
docstring_summary: returns None if at x,y,width,height no object occupies that rectangle,
              otherwise returns lower right corner of object that occupies given x,y position
docstring_tokens: returns None if at x y width height no object occupies that rectangle otherwise returns lower right corner of object that occupies given x y position
function: def isSpotOccupied(self, x, y, width, height):
          """ returns None if at x,y,width,height no object occupies that rectangle,
              otherwise returns lower right corner of object that occupies given x,y position
          """
          x2 = x + width
          y2 = y + height
  
          for shape in self._diagram.GetShapeList():
              if isinstance(shape, ogl.RectangleShape) or isinstance(shape, ogl.EllipseShape) or isinstance(shape, ogl.PolygonShape):
                  if shape.GetParent() and isinstance(shape.GetParent(), ogl.CompositeShape):
                      # skip, part of a composite shape
                      continue
  
                  if hasattr(shape, "GetModel"):
                      other_x, other_y, other_width, other_height = shape.GetModel().getEditorBounds()
                      other_x2 = other_x + other_width
                      other_y2 = other_y + other_height
                  else:
                      # shapes x,y are at the center of the shape, need to transform to upper left coordinate
                      other_width, other_height = shape.GetBoundingBoxMax()
                      other_x = shape.GetX() - other_width/2
                      other_y = shape.GetY() - other_height/2
  
                  other_x2 = other_x + other_width
                  other_y2 = other_y + other_height
                  # intersection check
                  if ((other_x2 < other_x or other_x2 > x) and
                      (other_y2 < other_y or other_y2 > y) and
                      (x2 < x or x2 > other_x) and
                      (y2 < y or y2 > other_y)):
                      return (other_x2, other_y2)
          return None
function_tokens: def isSpotOccupied ( self , x , y , width , height ) : x2 = x + width y2 = y + height for shape in self . _diagram . GetShapeList ( ) : if isinstance ( shape , ogl . RectangleShape ) or isinstance ( shape , ogl . EllipseShape ) or isinstance ( shape , ogl . PolygonShape ) : if shape . GetParent ( ) and isinstance ( shape . GetParent ( ) , ogl . CompositeShape ) : # skip, part of a composite shape continue if hasattr ( shape , "GetModel" ) : other_x , other_y , other_width , other_height = shape . GetModel ( ) . getEditorBounds ( ) other_x2 = other_x + other_width other_y2 = other_y + other_height else : # shapes x,y are at the center of the shape, need to transform to upper left coordinate other_width , other_height = shape . GetBoundingBoxMax ( ) other_x = shape . GetX ( ) - other_width / 2 other_y = shape . GetY ( ) - other_height / 2 other_x2 = other_x + other_width other_y2 = other_y + other_height # intersection check if ( ( other_x2 < other_x or other_x2 > x ) and ( other_y2 < other_y or other_y2 > y ) and ( x2 < x or x2 > other_x ) and ( y2 < y or y2 > other_y ) ) : return ( other_x2 , other_y2 ) return None