def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,<EOL>to_dir=os.curdir, delay=<NUM_LIT:15>, downloader_factory=get_best_downloader):
<EOL>to_dir = os.path.abspath(to_dir)<EOL>zip_name = "<STR_LIT>" % version<EOL>url = download_base + zip_name<EOL>saveto = os.path.join(to_dir, zip_name)<EOL>if not os.path.exists(saveto):  <EOL><INDENT>log.warn("<STR_LIT>", url)<EOL>downloader = downloader_factory()<EOL>downloader(url, saveto)<EOL><DEDENT>return os.path.realpath(saveto)<EOL>
Download setuptools from a specified location and return its filename

`version` should be a valid setuptools version number that is available
as an sdist for download under the `download_base` URL (which should end
with a '/'). `to_dir` is the directory where the egg will be downloaded.
`delay` is the number of seconds to pause before an actual download
attempt.

``downloader_factory`` should be a function taking no arguments and
returning a function for downloading a URL to a target.