def METHOD_NAME(
    filename: Path, cavities_file: Path, method: str, limit: int = -1, skip: int = 0
) -> Union[Path, None]:
    target_dir = cavities_file.parent
    target = target_path(filename, target_dir, method).absolute()
    data = orig_file(filename)
    print(f"Mutating {filename} using {method} storing at {target}")
    mutator = method_mapping[method]
    # Only the name of the file is in the cavities file, not the path
    changes = 0
    for i, (ofirst, olast) in enumerate(iter_cavities(filename.name, cavities_file)):
        if i < skip:
            continue
        if limit == -1 or changes < limit:
            # print(f"Mutate {hex(ofirst)}, {hex(olast)}")
            data[ofirst : olast + 1] = mutator(data[ofirst : olast + 1])
            changes += 1
        else:
            print(
                f"Abort on limit after {changes} iterations. Next was {ofirst}, {olast}"
            )
            break
    if changes == 0:
        return None
    with open(target, "wb") as dstf:
        dstf.write(data)
    return target