human
Give me a Python program to print (((('Succesfully    downloaded    ' + filename) + ' given the following:
I wrote the below code

    mkdir_p(dir)
    if (filename is None):
        filename = url.split('/')[(-1)]
    fpath = os.path.join(dir, filename)
    def hook(t):
        last_b = [0]
        def inner(b, bsize, tsize=None):
            if (tsize is not None):
                t.total = tsize
            t.update(((b - last_b[0]) * bsize))
            last_b[0] = b
        return inner
    try:
        with tqdm.tqdm(unit='B', unit_scale=True, miniters=1, desc=filename) as t:
            (fpath, _) = urllib.request.urlretrieve(url, fpath, reporthook=hook(t))
        statinfo = os.stat(fpath)
        size = statinfo.st_size
    except:
        logger.error('Failed    to    download    {}'.format(url))
        raise
    assert (size > 0), 'Download    an    empty    file!'
    print (((('Succesfully    downloaded    ' + filename) + '.    ') + str(size)) + '    bytes.')
    return fpath

What's a good function header?
assistant
#Here is Python program to print (((('Succesfully    downloaded    ' + filename) + '.

def download(url, dir, filename=None):