def METHOD_NAME(
    shapes: List[ImageSize],
    frames: List[Frame],
    nproc: int = NPROC,
) -> List[Frame]:
    """Execute the rle conversion in parallel."""
    if nproc > 1:
        with Pool(nproc) as pool:
            frames = pool.starmap(
                partial(frame_to_rle),
                tqdm(
                    zip(shapes, frames),
                    total=len(frames),
                ),
            )
    else:
        frames = [
            frame_to_rle(shape, frame)
            for shape, frame in tqdm(zip(shapes, frames), total=len(frames))
        ]
    sorted(frames, key=lambda frame: frame.name)
    return frames