///|
fn logit_named_prepare(
  base : BaseFormatter,
  state : LogitFormatterState,
  input : LogitInput,
) -> Unit raise @core.DataError {
  base.locations = input.snapshot()
  state.labelled.clear()
  if !log_value_truth(state.minor) {
    return
  }
  let mut ideal = true
  let mut index = 0
  while index < input.length() {
    let value = input.key_at(index).value()
    if !logit_is_decade(value) &&
      !logit_is_decade(
        scalar_numeric_op(
          ScalarNumber::Integer(@bigint.BigInt::from_int(1)),
          value,
          1,
        ),
      ) &&
      !logit_is_half(value, numpy_round=true) {
      ideal = false
      break
    }
    index += 1
  }
  if ideal {
    return
  }
  if !logit_count_less(input.length(), state.minor_threshold) {
    return
  }
  if logit_count_less(input.length(), state.minor_number) {
    let mut index = 0
    while index < input.length() {
      state.labelled.add(input.key_at(index))
      index += 1
    }
    return
  }
  let logits = logit_array_logits(base.locations)
  let differences : Array[Double] = []
  for index in 1..