def _get_files():
    """General script to download file from online sources. Each remote file
    should be specified in the list of dict REMOTE_FILES. Each entry in
    REMOTE_FILES contains:
    filename : the filename which is used by the test scripts
    cached : the filename which is stored in the cache directory
    url : the remote url. If str, it's a direct download. If it's a list, it's
    run as a command.
    zipped : if None, then the file is not zipped. If True, it extracts all
    the files (but be careful about the folder name). If str, it extracts only
    that specific file.

    Returns
    -------
    returncode : int
        code to send to shell (TODO: make sure you get 1 with exceptions)
    """
    for remote in REMOTE_FILES:

        final_file = DATA_PATH / remote['filename']

        if not final_file.exists():
            temp_file = DOWNLOADS_PATH / remote['cached']

            if not temp_file.exists():
                if remote['url'] is None:
                    print('missing URL, please contact developers')
                    return 1

                elif isinstance(remote['url'], list):
                    print('Running: ' + ' '.join(remote['url']))
                    run(remote['url'])
                else:
                    print('Downloading from ' + remote['url'])
                    _urlretrieve(remote['url'], temp_file)

            if remote['zipped'] is None:
                print('Copying ' + str(temp_file) + ' to ' + str(final_file))
                copyfile(str(temp_file), str(final_file))  # or maybe symlink

            elif remote['zipped'] is True:  # explicit testing
                with ZipFile(str(temp_file)) as zf:
                    print('Extracting all files in ' + remote['cached'] + ':\n\t' + '\n\t'.join(zf.namelist()))
                    zf.extractall(path=str(DATA_PATH))

            else:
                print('Extracting file ' + remote['zipped'] + ' to ' +
                      str(final_file))
                with ZipFile(str(temp_file)) as zf:
                    extracted = Path(
                        zf.extract(remote['zipped'], path=str(DOWNLOADS_PATH)))
                    extracted.rename(final_file)

    return 0