<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ensure_file(url, path, md5sum=None):
 """ If file is not already at 'path', then download from 'url' and put it there. If md5sum is provided, and 'path' exists, check that file matches the md5sum. If not, re-download. """


    if not os.path.isfile(path) or (md5sum and md5sum != file_md5(path)):
        download_file(url, path)