def main(argv, version=DEFAULT_VERSION):
try:<EOL><INDENT>import setuptools<EOL><DEDENT>except ImportError:<EOL><INDENT>egg = None<EOL>try:<EOL><INDENT>egg = download_setuptools(version, delay=<NUM_LIT:0>)<EOL>sys.path.insert(<NUM_LIT:0>,egg)<EOL>from setuptools.command.easy_install import main<EOL>return main(list(argv)+[egg])   <EOL><DEDENT>finally:<EOL><INDENT>if egg and os.path.exists(egg):<EOL><INDENT>os.unlink(egg)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if setuptools.__version__ == '<STR_LIT>':<EOL><INDENT>print((<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>), file=sys.stderr)<EOL>sys.exit(<NUM_LIT:2>)<EOL><DEDENT><DEDENT>req = "<STR_LIT>"+version<EOL>import pkg_resources<EOL>try:<EOL><INDENT>pkg_resources.require(req)<EOL><DEDENT>except pkg_resources.VersionConflict:<EOL><INDENT>try:<EOL><INDENT>from setuptools.command.easy_install import main<EOL><DEDENT>except ImportError:<EOL><INDENT>from easy_install import main<EOL><DEDENT>main(list(argv)+[download_setuptools(delay=<NUM_LIT:0>)])<EOL>sys.exit(<NUM_LIT:0>) <EOL><DEDENT>else:<EOL><INDENT>if argv:<EOL><INDENT>from setuptools.command.easy_install import main<EOL>main(argv)<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>",version,"<STR_LIT>")<EOL>print('<STR_LIT>')<EOL><DEDENT><DEDENT>
Install or upgrade setuptools and EasyInstall