def METHOD_NAME(tmp_path, extra_arg, kgo):
    """Test thresholding and collapsing realizations where the data being
    thresholded is masked."""
    kgo_dir = acc.kgo_root() / "threshold/masked_collapse"
    kgo_path = kgo_dir / kgo
    input_path = kgo_dir / "input.nc"
    output_path = tmp_path / "output.nc"
    args = [
        input_path,
        "--output",
        output_path,
        "--threshold-values",
        "500",
        "--collapse-coord",
        "realization",
    ]
    args += extra_arg
    run_cli(args)
    acc.compare(output_path, kgo_path)