<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> import os <EOL> import subprocess <EOL> import sys <EOL> if sys . version_info [ <NUM_LIT:0> ] >= <NUM_LIT:3> : <EOL> VENV_NAME = '<STR_LIT>' <EOL> PATCH_DJANGO_NOSE = True <EOL> else : <EOL> VENV_NAME = '<STR_LIT>' <EOL> PATCH_DJANGO_NOSE = False <EOL> TESTS = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> REQUIREMENTS = os . path . join ( TESTS , '<STR_LIT>' ) <EOL> WITH_VENV = os . path . join ( TESTS , '<STR_LIT>' ) <EOL> VENV = os . path . abspath ( os . path . join ( TESTS , '<STR_LIT:..>' , VENV_NAME ) ) <EOL> def call ( * args ) : <EOL> """<STR_LIT>""" <EOL> if subprocess . call ( args ) : <EOL> raise SystemExit ( '<STR_LIT>' . format ( args ) ) <EOL> def pip_install ( * args ) : <EOL> """<STR_LIT>""" <EOL> call ( WITH_VENV , VENV_NAME , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , * args ) <EOL> def patch_django_nose ( ) : <EOL> """<STR_LIT>""" <EOL> python = '<STR_LIT>' + '<STR_LIT:.>' . join ( map ( str , sys . version_info [ : <NUM_LIT:2> ] ) ) <EOL> django_nose = os . path . join ( <EOL> VENV , '<STR_LIT>' , python , '<STR_LIT>' , '<STR_LIT>' ) <EOL> call ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , django_nose ) <EOL> with open ( os . path . join ( django_nose , '<STR_LIT>' ) , '<STR_LIT>' ) as f : <EOL> lines = [ line for line in f . readlines ( ) if '<STR_LIT>' not in line ] <EOL> f . seek ( <NUM_LIT:0> ) <EOL> f . truncate ( ) <EOL> f . writelines ( lines ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> call ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , sys . executable , VENV ) <EOL> pip_install ( '<STR_LIT>' , REQUIREMENTS ) <EOL> if PATCH_DJANGO_NOSE : <EOL> patch_django_nose ( ) </s>
