def METHOD_NAME(self, allow_upstream=False):
    """
    Download the tarball to the upstream directory.
    If allow_upstream is False and the package cannot be found
    on the sage mirrors, fall back to downloading it from
    the upstream URL if the package has one.
    """
    if not self.filename:
        raise ValueError('non-normal package does define a tarball, so cannot download')
    destination = self.upstream_fqn
    if os.path.isfile(destination):
        if self.checksum_verifies():
            log.info('Using cached file {destination}'.format(destination=destination))
            return
        else:
            # Garbage in the upstream directory? Ignore it.
            # Don't delete it because maybe somebody just forgot to
            # update the checksum (Trac #23972).
            log.warning('Invalid checksum; ignoring cached file {destination}'
                        .format(destination=destination))
    successful_download = False
    log.info('Attempting to download package {0} from mirrors'.format(self.filename))
    for mirror in MirrorList():
        url = mirror + '/'.join(['spkg', 'upstream', self.package.name, self.filename])
        log.info(url)
        try:
            Download(url, destination).run()
            successful_download = True
            break
        except IOError:
            log.debug('File not on mirror')
    if not successful_download:
        url = self.package.tarball_upstream_url
        if allow_upstream and url:
            log.info('Attempting to download from {}'.format(url))
            try:
                Download(url, destination).run()
            except IOError:
                raise FileNotMirroredError('tarball does not exist on mirror network and neither at the upstream URL')
        else:
            raise FileNotMirroredError('tarball does not exist on mirror network')
    if not self.checksum_verifies():
        raise ChecksumError('checksum does not match')