code: def div_or_else(
      cola: Column,
      colb: Column,
      default: Union[float, Column] = 0.0,
  ) -> Column:
      """Return result of division of cola by colb or default if colb is zero.
  
      :param cola: dividend
      :param colb: divisor
      :param default: default value
      :returns: result of division or zero
      """
      if not isinstance(default, Column):
          default = F.lit(default)
  
      return F.when(colb == F.lit(0.0), default).otherwise(cola / colb)
  
imports: from __future__ import annotations
  from typing import Optional, Union
  from pyspark.sql import Column
  from pyspark.sql import functions
label_desc: Use image node_id 2 for calling a global function with example usage: div_or_else(cola, colb, default) and returns: F