<s> """<STR_LIT>""" <EOL> import sys <EOL> import signal <EOL> from sys import exit <EOL> from xml . etree import ElementTree as ET <EOL> __version__ = '<STR_LIT>' <EOL> def _main ( ) : <EOL> """<STR_LIT>""" <EOL> import argparse <EOL> from pygments . lexers import JsonLexer , XmlLexer <EOL> from pjson . core import format_code , color_yo_shit <EOL> parser = argparse . ArgumentParser ( description = "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , action = "<STR_LIT:store_true>" , help = "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> args = parser . parse_args ( ) <EOL> if args . x and args . b : <EOL> sys . stderr . write ( "<STR_LIT>" ) <EOL> parser . print_usage ( sys . stderr ) <EOL> exit ( <NUM_LIT:1> ) <EOL> colorize = args . t or sys . stdout . isatty ( ) <EOL> if args . b : <EOL> for line in sys . stdin : <EOL> text = format_code ( line ) <EOL> if colorize : <EOL> text = color_yo_shit ( text , JsonLexer ( ) ) <EOL> print ( text ) <EOL> else : <EOL> data = sys . stdin . read ( ) <EOL> try : <EOL> text = format_code ( data , args . x ) <EOL> if colorize : <EOL> text = color_yo_shit ( text , XmlLexer ( ) if args . x else JsonLexer ( ) ) . rstrip ( '<STR_LIT:\r\n>' ) <EOL> print ( text ) <EOL> except ( ValueError , ET . ParseError ) as e : <EOL> message = str ( e ) <EOL> if colorize : <EOL> red = '<STR_LIT>' <EOL> reset_colors = '<STR_LIT>' <EOL> message = '<STR_LIT>' . join ( [ red , message , reset_colors ] ) <EOL> sys . stderr . write ( message + '<STR_LIT:\n>' ) <EOL> exit ( <NUM_LIT:1> ) <EOL> def main ( ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> signal . signal ( signal . SIGPIPE , lambda signum , frame : sys . exit ( <NUM_LIT:1> ) ) <EOL> except AttributeError : <EOL> pass <EOL> try : <EOL> _main ( ) <EOL> except KeyboardInterrupt : <EOL> exit ( <NUM_LIT:1> ) </s>
