def get_grouped_file_previews(files):
    groups = {'all': []}
    for file_info in files:
        system_file = file_info.system_file

        filedict = {'id': system_file.id,
                    'object': system_file,
                    'name': file_info.filename,
                    'preview': json.loads(system_file.filepreview) if system_file.filepreview else None,
                    'url': get_storage(local=False).url(system_file.filepath.name),
                    'slug': file_info.parameter.parameter.script_param if file_info.parameter else None,
                    'basename': os.path.basename(system_file.filepath.name),
                    'filetype': system_file.filetype,
                    'size_bytes': system_file.size_bytes,
                    }
        try:
            groups[system_file.filetype].append(filedict)
        except __HOLE__:
            groups[system_file.filetype] = [filedict]
        if system_file.filetype != 'all':
            groups['all'].append(filedict)
    return groups
dataset/ETHPy150Open wooey/Wooey/wooey/backend/utils.py/get_grouped_file_previews