def prepare_patches(output_folder, **kwargs):
    '\n    initialise patch data if ``output_folder`` does not exist, else load existing patch data\n\n    Args:\n        output_folder: folder for storing patch data\n        **kwargs: arguments passed to :py:func:`~local2global_embedding.patches.create_patch_data`\n\n    Returns:\n        patch_data, patch_graph\n    '
    output_folder = Path(output_folder)
    if output_folder.is_dir():
        patch_graph = torch.load((output_folder / 'patch_graph.pt'))
        patch_data = [torch.load((output_folder / f'patch{i}.pt')) for i in range(patch_graph.num_nodes)]
    else:
        (patch_data, patch_graph) = create_patch_data(**kwargs)
        output_folder.mkdir(parents=True)
        torch.save(patch_graph, (output_folder / 'patch_graph.pt'))
        for (i, data) in enumerate(patch_data):
            torch.save(data, (output_folder / f'patch{i}.pt'))
    return (patch_data, patch_graph)
initialise patch data if ``output_folder`` does not exist, else load existing patch data

Args:
    output_folder: folder for storing patch data
    **kwargs: arguments passed to :py:func:`~local2global_embedding.patches.create_patch_data`

Returns:
    patch_data, patch_graph
def prepare_patches(output_folder, **kwargs):
    '\n    initialise patch data if ``output_folder`` does not exist, else load existing patch data\n\n    Args:\n        output_folder: folder for storing patch data\n        **kwargs: arguments passed to :py:func:`~local2global_embedding.patches.create_patch_data`\n\n    Returns:\n        patch_data, patch_graph\n    '
    output_folder = Path(output_folder)
    if output_folder.is_dir():
        patch_graph = torch.load((output_folder / 'patch_graph.pt'))
        patch_data = [torch.load((output_folder / f'patch{i}.pt')) for i in range(patch_graph.num_nodes)]
    else:
        (patch_data, patch_graph) = create_patch_data(**kwargs)
        output_folder.mkdir(parents=True)
        torch.save(patch_graph, (output_folder / 'patch_graph.pt'))
        for (i, data) in enumerate(patch_data):
            torch.save(data, (output_folder / f'patch{i}.pt'))
    return (patch_data, patch_graph)