def getRectArea(*args):
rect = args[<NUM_LIT:0>]<EOL>if len(args) > <NUM_LIT:1>:<EOL><INDENT>unit = args[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>unit = "<STR_LIT>"    <EOL><DEDENT>u = {"<STR_LIT>": (<NUM_LIT:1>,<NUM_LIT:1>), "<STR_LIT>": (<NUM_LIT:1.>,<NUM_LIT>), "<STR_LIT>": (<NUM_LIT>, <NUM_LIT>), "<STR_LIT>": (<NUM_LIT>, <NUM_LIT>)}<EOL>f = (u[unit][<NUM_LIT:0>] / u[unit][<NUM_LIT:1>])**<NUM_LIT:2><EOL>return f * rect.width * rect.height<EOL>
Calculate area of rectangle.\nparameter is one of 'px' (default), 'in', 'cm', or 'mm'.