def main():
kwargs = {'<STR_LIT:description>': '<STR_LIT>',<EOL>'<STR_LIT>': argparse.ArgumentDefaultsHelpFormatter}<EOL>parser = argparse.ArgumentParser(**kwargs)<EOL>parser.add_argument('<STR_LIT>', '<STR_LIT>',<EOL>help='<STR_LIT>',<EOL>action='<STR_LIT:store_true>')<EOL>parser.add_argument('<STR_LIT>', '<STR_LIT>',<EOL>help='<STR_LIT>',<EOL>action='<STR_LIT:store_true>')<EOL>chelp = '<STR_LIT>'<EOL>chelp += '<STR_LIT>'<EOL>parser.add_argument('<STR_LIT:-c>', '<STR_LIT>',<EOL>help=chelp,<EOL>metavar='<STR_LIT>',<EOL>nargs=<NUM_LIT:1>,<EOL>type=int,<EOL>default=[<NUM_LIT:1>])<EOL>parser.add_argument('<STR_LIT:filename>')<EOL>args = parser.parse_args()<EOL>if args.noxml:<EOL><INDENT>set_option('<STR_LIT>', False)<EOL><DEDENT>if args.short:<EOL><INDENT>set_option('<STR_LIT>', True)<EOL><DEDENT>codestream_level = args.codestream[<NUM_LIT:0>]<EOL>if codestream_level not in [<NUM_LIT:0>, <NUM_LIT:1>, <NUM_LIT:2>]:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if codestream_level == <NUM_LIT:0>:<EOL><INDENT>set_option('<STR_LIT>', False)<EOL><DEDENT>elif codestream_level == <NUM_LIT:2>:<EOL><INDENT>set_option('<STR_LIT>', True)<EOL><DEDENT>filename = args.filename<EOL>with warnings.catch_warnings(record=True) as wctx:<EOL><INDENT>jp2 = Jp2k(filename)<EOL>if jp2._codec_format == lib.openjp2.CODEC_J2K:<EOL><INDENT>if codestream_level == <NUM_LIT:0>:<EOL><INDENT>print('<STR_LIT>'.format(os.path.basename(filename)))<EOL><DEDENT>elif codestream_level == <NUM_LIT:1>:<EOL><INDENT>print(jp2)<EOL><DEDENT>elif codestream_level == <NUM_LIT:2>:<EOL><INDENT>print('<STR_LIT>'.format(os.path.basename(filename)))<EOL>print(jp2.get_codestream(header_only=False))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print(jp2)<EOL><DEDENT>if len(wctx) > <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT:\n>")<EOL><DEDENT>for warning in wctx:<EOL><INDENT>print("<STR_LIT>".format(warning.filename,<EOL>warning.lineno,<EOL>warning.category.__name__,<EOL>warning.message))<EOL><DEDENT><DEDENT>
Entry point for console script jp2dump.