code: def process_work(
      rank, world_size, fname, order, sync_fname, out_folder, indices
  ):
      sync_url = f"file://{sync_fname}"
      if world_size > 1:
          init_process_group(
              "nccl", sync_url, rank=rank, world_size=world_size
          )
  
      loader = Loader(
          fname,
          8,
          num_workers=2,
          order=order,
          drop_last=False,
          distributed=world_size > 1,
          indices=indices,
      )
  
      result = []
      for _ in range(3):
          content = np.concatenate(
              [x[0].numpy().reshape(-1).copy() for x in loader]
          )
          result.append(content)
      result = np.stack(result)
  
      np.save(path.join(out_folder, f"result-{rank}.npy"), result)
  
imports: from collections import defaultdict
  from tempfile import TemporaryDirectory
  from os import path
  from typing import Counter
  import pytest
  from assertpy import assert_that
  import numpy
  from torch.utils.data import Dataset, distributed
  from torch.multiprocessing import spawn, Queue
  from torch.distributed import init_process_group
  from ffcv.loader.loader import ORDER_TYPE, OrderOption
  from ffcv.writer import DatasetWriter
  from ffcv.fields import IntField, BytesField
  from ffcv import Loader
label_desc: Use image node_id 1 for calling a global function with example usage: process_work(rank, world_size, fname, order, sync_fname, out_folder, indices) without return types