code: def hardy_weinberg(genotypes: Union[Column, str]) -> Column:
      """
      Computes statistics relating to the Hardy Weinberg equilibrium. See :ref:`variant-qc` for more details.
  
      Added in version 0.3.0.
  
      Examples:
          >>> genotypes = [
          ... Row(calls=[1, 1]),
          ... Row(calls=[1, 0]),
          ... Row(calls=[0, 0])]
          >>> df = spark.createDataFrame([Row(genotypes=genotypes)], 'genotypes: array<struct<calls: array<int>>>')
          >>> df.select(glow.expand_struct(glow.hardy_weinberg('genotypes'))).collect()
          [Row(hetFreqHwe=0.6, pValueHwe=0.7)]
  
      Args:
          genotypes : The array of genotype structs with ``calls`` field
  
      Returns:
          A struct containing two fields, ``hetFreqHwe`` (the expected heterozygous frequency according to Hardy-Weinberg equilibrium) and ``pValueHwe`` (the associated p-value)
      """
      assert check_argument_types()
      output = Column(
          sc()._jvm.io.projectglow.functions.hardy_weinberg(
              _to_java_column(genotypes)
          )
      )
      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 16 for calling a global function with example usage: hardy_weinberg(genotypes) and returns: output