def download_md5(uri, dest):
    """
    downloads file from uri to file dest
    """
    # Create intermediate directories as necessary, #2970
    dirname = os.path.dirname(dest)
    if len(dirname):
        try:
            os.makedirs(dirname)
        except __HOLE__ as e:
            if e.errno != errno.EEXIST:
                raise

    sys.stdout.write('Downloading %s to %s...' % (uri, dest))
    sys.stdout.flush()
    try:
        download_with_resume(uri, dest)
        sys.stdout.write(' done.\n')
    except Exception as e:
        # delete partially downloaded data
        if os.path.exists(dest):
            os.unlink(dest)
        sys.stdout.write(' failed (%s)!\n' % e)
        raise
dataset/ETHPy150Open ros/catkin/cmake/test/download_checkmd5.py/download_md5