<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> import traceback <EOL> from docopt import docopt <EOL> from django . core . management import BaseCommand <EOL> from django . core . management . base import OutputWrapper <EOL> class DocOptCommand ( BaseCommand ) : <EOL> docs = '<STR_LIT>' <EOL> def handle_docopt ( self , arguments ) : <EOL> pass <EOL> def print_help ( self , prog_name , subcommand ) : <EOL> sys . stdout . write ( self . docs ) <EOL> def run_from_argv ( self , argv ) : <EOL> arguments = docopt ( self . docs , argv [ <NUM_LIT:2> : ] ) <EOL> self . _handle_default_options ( arguments ) <EOL> try : <EOL> self . execute ( * [ ] , ** arguments ) <EOL> except Exception as e : <EOL> stderr = getattr ( self , '<STR_LIT>' , OutputWrapper ( sys . stderr , self . style . ERROR ) ) <EOL> if arguments . get ( '<STR_LIT>' , False ) : <EOL> stderr . write ( traceback . format_exc ( ) ) <EOL> else : <EOL> stderr . write ( '<STR_LIT>' % ( e . __class__ . __name__ , e ) ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def _handle_default_options ( self , arguments ) : <EOL> if arguments . get ( '<STR_LIT>' ) : <EOL> os . environ [ '<STR_LIT>' ] = arguments [ '<STR_LIT>' ] <EOL> if arguments . get ( '<STR_LIT>' ) : <EOL> sys . path . insert ( <NUM_LIT:0> , arguments [ '<STR_LIT>' ] ) <EOL> def handle ( self , * args , ** options ) : <EOL> return self . handle_docopt ( options ) </s>
