<s> """<STR_LIT>""" <EOL> import sys <EOL> import logging <EOL> import warnings <EOL> from tests . config import configure <EOL> logging . disable ( logging . CRITICAL ) <EOL> warnings . simplefilter ( '<STR_LIT:default>' ) <EOL> warnings . filterwarnings ( '<STR_LIT:error>' , category = DeprecationWarning ) <EOL> for category in [ PendingDeprecationWarning , UserWarning , ImportWarning ] : <EOL> warnings . filterwarnings ( '<STR_LIT:ignore>' , category = category ) <EOL> def run_tests ( verbosity , * test_args ) : <EOL> from django_nose import NoseTestSuiteRunner <EOL> test_runner = NoseTestSuiteRunner ( verbosity = verbosity ) <EOL> if not test_args : <EOL> test_args = [ '<STR_LIT>' ] <EOL> num_failures = test_runner . run_tests ( test_args ) <EOL> if num_failures : <EOL> sys . exit ( num_failures ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> args = sys . argv [ <NUM_LIT:1> : ] <EOL> verbosity = <NUM_LIT:1> <EOL> if not args : <EOL> import multiprocessing <EOL> try : <EOL> num_cores = multiprocessing . cpu_count ( ) <EOL> except NotImplementedError : <EOL> num_cores = <NUM_LIT:4> <EOL> args = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' % num_cores ] <EOL> else : <EOL> has_options = any ( map ( lambda x : x . startswith ( '<STR_LIT>' ) , args ) ) <EOL> if not has_options : <EOL> args . extend ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> else : <EOL> for arg in args : <EOL> if arg . startswith ( '<STR_LIT>' ) : <EOL> verbosity = int ( arg [ - <NUM_LIT:1> ] ) <EOL> args = [ arg for arg in args if not arg . startswith ( '<STR_LIT:->' ) ] <EOL> configure ( ) <EOL> run_tests ( verbosity , * args ) </s>
