<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> import argparse <EOL> from subprocess import call <EOL> try : <EOL> from subprocess import check_output <EOL> except ImportError : <EOL> import subprocess <EOL> check_output = lambda x : subprocess . Popen ( x , stdout = subprocess . PIPE ) . communicate ( ) [ <NUM_LIT:0> ] <EOL> NAME = os . path . basename ( os . path . dirname ( __file__ ) ) <EOL> ROOT = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> os . environ [ '<STR_LIT>' ] = os . pathsep . join ( [ ROOT , <EOL> os . path . join ( ROOT , '<STR_LIT>' ) ] ) <EOL> SETTINGS = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def main ( ) : <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , action = '<STR_LIT:store_true>' , <EOL> help = '<STR_LIT>' ) <EOL> parser . add_argument ( '<STR_LIT>' , choices = SETTINGS , <EOL> help = '<STR_LIT>' ) <EOL> args = parser . parse_args ( ) <EOL> settings = args . settings and [ args . settings ] or SETTINGS <EOL> results = [ ] <EOL> django_admin = check_output ( [ '<STR_LIT>' , '<STR_LIT>' ] ) . strip ( ) <EOL> for i , settings_module in enumerate ( settings ) : <EOL> print ( '<STR_LIT>' % settings_module ) <EOL> os . environ [ '<STR_LIT>' ] = '<STR_LIT>' % settings_module <EOL> if args . with_coverage and i > <NUM_LIT:0> : <EOL> test_cmd = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> elif args . with_coverage : <EOL> test_cmd = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> else : <EOL> test_cmd = [ ] <EOL> test_cmd += [ django_admin , '<STR_LIT:test>' ] <EOL> results . append ( call ( test_cmd ) ) <EOL> if args . with_coverage : <EOL> results . append ( call ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) ) <EOL> sys . exit ( any ( results ) and <NUM_LIT:1> or <NUM_LIT:0> ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
