def get_process_and_label(
    ind: int,
    completion: Completion,
    step_tag: str,
    add_step_prefix: bool = False,
    neutral_is_good: bool = True,
) -> tuple[str, str]:
    """Extract current reason step of index `ind` and corresponding label."""
    prefix = f"Step {ind + 1}: " if add_step_prefix else ""
    process = f"{prefix}{completion.text} {step_tag}"
    rating = (
        completion.rating if completion.rating is not None else 0
    )  # treat null rating as `neutral`

    if rating == 0:
        label = "+" if neutral_is_good else "-"
    else:
        label = "+" if rating > 0 else "-"

    return process, label
Extract current reason step of index `ind` and corresponding label.
preprocess/src/preprocessors/prm800k.py