code: def hard_calls(
      probabilities: Union[Column, str],
      numAlts: Union[Column, str],
      phased: Union[Column, str],
      threshold: float = None,
  ) -> Column:
      """
      Converts an array of probabilities to hard calls. The probabilities are assumed to be diploid. See :ref:`variant-data-transformations` for more details.
  
      Added in version 0.3.0.
  
      Examples:
          >>> df = spark.createDataFrame([Row(probs=[0.95, 0.05, 0.0])])
          >>> df.select(glow.hard_calls('probs', numAlts=lit(1), phased=lit(False)).alias('calls')).collect()
          [Row(calls=[0, 0])]
          >>> df = spark.createDataFrame([Row(probs=[0.05, 0.95, 0.0])])
          >>> df.select(glow.hard_calls('probs', numAlts=lit(1), phased=lit(False)).alias('calls')).collect()
          [Row(calls=[0, 1])]
          >>> # Use the threshold parameter to change the minimum probability required for a call
          >>> df = spark.createDataFrame([Row(probs=[0.05, 0.95, 0.0])])
          >>> df.select(glow.hard_calls('probs', numAlts=lit(1), phased=lit(False), threshold=0.99).alias('calls')).collect()
          [Row(calls=[-1, -1])]
  
      Args:
          probabilities : The array of probabilities to convert
          numAlts : The number of alternate alleles
          phased : Whether the probabilities are phased. If phased, we expect one ``2 * numAlts`` values in the probabilities array. If unphased, we expect one probability per possible genotype.
          threshold : The minimum probability to make a call. If no probability falls into the range of ``[0, 1 - threshold]`` or ``[threshold, 1]``, a no-call (represented by ``-1`` s) will be emitted. If not provided, this parameter defaults to ``0.9``.
  
      Returns:
          An array of hard calls
      """
      assert check_argument_types()
      if threshold is None:
          output = Column(
              sc()._jvm.io.projectglow.functions.hard_calls(
                  _to_java_column(probabilities),
                  _to_java_column(numAlts),
                  _to_java_column(phased),
              )
          )
      else:
          output = Column(
              sc()._jvm.io.projectglow.functions.hard_calls(
                  _to_java_column(probabilities),
                  _to_java_column(numAlts),
                  _to_java_column(phased),
                  threshold,
              )
          )
      assert check_return_type(output)
      return output
  
imports: from pyspark import SparkContext
  from pyspark.sql.column import Column, _to_java_column, _to_seq
  from typeguard import check_argument_types, check_return_type
  from typing import Union
label_desc: Use image node_id 10 for calling a global function with example usage: hard_calls(probabilities, numAlts, phased, threshold) and returns: output