def PaperSize(s):
size = s.lower()<EOL>f = "<STR_LIT:p>"<EOL>if size.endswith("<STR_LIT>"):<EOL><INDENT>f = "<STR_LIT:l>"<EOL>size = size[:-<NUM_LIT:2>]<EOL><DEDENT>if size.endswith("<STR_LIT>"):<EOL><INDENT>size = size[:-<NUM_LIT:2>]<EOL><DEDENT>rc = paperSizes.get(size, (-<NUM_LIT:1>, -<NUM_LIT:1>))<EOL>if f == "<STR_LIT:p>":<EOL><INDENT>return rc<EOL><DEDENT>return (rc[<NUM_LIT:1>], rc[<NUM_LIT:0>])<EOL>
Return a tuple (width, height) for a given paper format string. 'A4-L' will
    return (842, 595), the values for A4 landscape. Suffix '-P' and no suffix
    returns portrait.