<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def LoadFits(name):
 """ Loads data for a fit. If data is not available, downloads it before loading. """

    if name not in fits_collection.keys():
        raise Exception('Invalid fit name : %s'%name)
    else:
        testPath = DataPath() + '/' + fits_collection[name].data_url.split('/')[-1]
        if (not os.path.isfile(testPath)):
            DownloadData(name)
        fit = fits_collection[name].fit_class(name.split('surfinBH')[-1])
        print('Loaded %s fit.'%name)
        return fit