def _get_parent(heap, idx):
    """Get the parent index-value of the input index."""
    idx_parent = (idx - 1) // 2
    val_parent = heap._idx2val(idx_parent) if idx != 0 else None
    return idx_parent, val_parent