@memoized
def getBox(box, pagesize):
 box = str(box).split()
 if (len(box) != 4):
  raise Exception('box not defined right way')
 (x, y, w, h) = [getSize(pos) for pos in box]
 return getCoords(x, y, w, h, pagesize)

@ memoized def getBox ( box , pagesize ) : box = str ( box ) . split ( ) if ( len ( box ) != 4 ) : raise Exception ( 'box not defined right way' ) ( x , y , w , h ) = [ getSize ( pos ) for pos in box ] return getCoords ( x , y , w , h , pagesize )
parse sizes by corners in the form: <x-left> <y-upper> <width> <height> the last to values with negative values are interpreted as offsets form the right and lower border .