code: def verify_total_ordering_broadcast(
      lhs: Any, rhs: Any, dummy: Any, dtype: pl.PolarsDataType
  ) -> None:
      ref = reference_ordering_propagating(lhs, rhs)
      refmiss = reference_ordering_missing(lhs, rhs)
  
      # Add dummy variable so we don't broadcast inherently.
      assert dummy is not None
      df = pl.DataFrame(
          {"l": [lhs, dummy], "r": [rhs, dummy]},
          schema={"l": dtype, "r": dtype},
      )
  
      ans_first = df.select(
          (pl.col("l") == pl.col("r").first()).alias("eq"),
          (pl.col("l") != pl.col("r").first()).alias("ne"),
          (pl.col("l") < pl.col("r").first()).alias("lt"),
          (pl.col("l") <= pl.col("r").first()).alias("le"),
          (pl.col("l") > pl.col("r").first()).alias("gt"),
          (pl.col("l") >= pl.col("r").first()).alias("ge"),
          pl.col("l")
          .eq_missing(pl.col("r").first())
          .alias("eq_missing"),
          pl.col("l")
          .ne_missing(pl.col("r").first())
          .alias("ne_missing"),
      )
  
      ans_scalar = df.select(
          (pl.col("l") == rhs).alias("eq"),
          (pl.col("l") != rhs).alias("ne"),
          (pl.col("l") < rhs).alias("lt"),
          (pl.col("l") <= rhs).alias("le"),
          (pl.col("l") > rhs).alias("gt"),
          (pl.col("l") >= rhs).alias("ge"),
          (pl.col("l").eq_missing(rhs)).alias("eq_missing"),
          (pl.col("l").ne_missing(rhs)).alias("ne_missing"),
      )
  
      ans_correct_dict = {
          "eq": [
              ref and ref == "="
          ],  # "ref and X" propagates ref is None
          "ne": [ref and ref != "="],
          "lt": [ref and ref == "<"],
          "le": [ref and (ref == "<" or ref == "=")],
          "gt": [ref and ref == ">"],
          "ge": [ref and (ref == ">" or ref == "=")],
          "eq_missing": [refmiss == "="],
          "ne_missing": [refmiss != "="],
      }
      ans_correct = pl.DataFrame(
          ans_correct_dict,
          schema={c: pl.Boolean for c in ans_correct_dict},
      )
  
      assert_frame_equal(ans_first[:1], ans_correct)
      assert_frame_equal(ans_scalar[:1], ans_correct)
  
imports: from __future__ import annotations
  import math
  from contextlib import nullcontext
  from typing import Any, ContextManager
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 12 for calling a global function with example usage: verify_total_ordering_broadcast(lhs, rhs, dummy, dtype) without return types