<s> r"""<STR_LIT>""" <EOL> import django . utils . simplejson <EOL> def main ( ) : <EOL> import sys <EOL> if len ( sys . argv ) == <NUM_LIT:1> : <EOL> infile = sys . stdin <EOL> outfile = sys . stdout <EOL> elif len ( sys . argv ) == <NUM_LIT:2> : <EOL> infile = open ( sys . argv [ <NUM_LIT:1> ] , '<STR_LIT:rb>' ) <EOL> outfile = sys . stdout <EOL> elif len ( sys . argv ) == <NUM_LIT:3> : <EOL> infile = open ( sys . argv [ <NUM_LIT:1> ] , '<STR_LIT:rb>' ) <EOL> outfile = open ( sys . argv [ <NUM_LIT:2> ] , '<STR_LIT:wb>' ) <EOL> else : <EOL> raise SystemExit ( "<STR_LIT>" % ( sys . argv [ <NUM_LIT:0> ] , ) ) <EOL> try : <EOL> obj = simplejson . load ( infile ) <EOL> except ValueError , e : <EOL> raise SystemExit ( e ) <EOL> simplejson . dump ( obj , outfile , sort_keys = True , indent = <NUM_LIT:4> ) <EOL> outfile . write ( '<STR_LIT:\n>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
