code: def genotype_states(genotypes: Union[Column, str]) -> Column:
      """
      Gets the number of alternate alleles for an array of genotype structs. Returns ``-1`` if there are any ``-1`` s (no-calls) in the calls array.
  
      Added in version 0.3.0.
  
      Examples:
          >>> genotypes = [
          ... Row(calls=[1, 1]),
          ... Row(calls=[1, 0]),
          ... Row(calls=[0, 0]),
          ... Row(calls=[-1, -1])]
          >>> df = spark.createDataFrame([Row(genotypes=genotypes)], 'genotypes: array<struct<calls: array<int>>>')
          >>> df.select(glow.genotype_states('genotypes').alias('states')).collect()
          [Row(states=[2, 1, 0, -1])]
  
      Args:
          genotypes : An array of genotype structs with ``calls`` field
  
      Returns:
          An array of integers containing the number of alternate alleles in each call array
      """
      assert check_argument_types()
      output = Column(
          sc()._jvm.io.projectglow.functions.genotype_states(
              _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 23 for calling a global function with example usage: genotype_states(genotypes) and returns: output