code: def explode_trio_matrix(
      tm: hl.MatrixTable,
      col_keys: List[str] = ["s"],
      keep_trio_cols: bool = True,
      keep_trio_entries: bool = False,
  ) -> hl.MatrixTable:
      """Splits a trio MatrixTable back into a sample MatrixTable.
  
      Example
      -------
      >>> # Create a trio matrix from a sample matrix
      >>> pedigree = hl.Pedigree.read('data/case_control_study.fam')
      >>> trio_dataset = hl.trio_matrix(dataset, pedigree, complete_trios=True)
  
      >>> # Explode trio matrix back into a sample matrix
      >>> exploded_trio_dataset = explode_trio_matrix(trio_dataset)
  
      Notes
      -----
      The resulting MatrixTable column schema is the same as the proband/father/mother schema,
      and the resulting entry schema is the same as the proband_entry/father_entry/mother_entry schema.
      If the `keep_trio_cols` option is set, then an additional `source_trio` column is added with the trio column data.
      If the `keep_trio_entries` option is set, then an additional `source_trio_entry` column is added with the trio entry data.
  
      Note
      ----
      This assumes that the input MatrixTable is a trio MatrixTable (similar to
      the result of :func:`~.trio_matrix`) Its entry schema has to contain
      'proband_entry`, `father_entry` and `mother_entry` all with the same type.
      Its column schema has to contain 'proband`, `father` and `mother` all with
      the same type.
  
      Parameters
      ----------
      tm : :class:`.MatrixTable`
          Trio MatrixTable (entries have to be a Struct with `proband_entry`, `mother_entry` and `father_entry` present)
      col_keys : :obj:`list` of str
          Column key(s) for the resulting sample MatrixTable
      keep_trio_cols: bool
          Whether to add a `source_trio` column with the trio column data (default `True`)
      keep_trio_entries: bool
          Whether to add a `source_trio_entries` column with the trio entry data (default `False`)
  
      Returns
      -------
      :class:`.MatrixTable`
          Sample MatrixTable
      """
  
      select_entries_expr = {
          "__trio_entries": hl.array(
              [tm.proband_entry, tm.father_entry, tm.mother_entry]
          )
      }
      if keep_trio_entries:
          select_entries_expr["source_trio_entry"] = hl.struct(
              **tm.entry
          )
      tm = tm.select_entries(**select_entries_expr)
  
      tm = tm.key_cols_by()
      select_cols_expr = {
          "__trio_members": hl.enumerate(
              hl.array([tm.proband, tm.father, tm.mother])
          )
      }
      if keep_trio_cols:
          select_cols_expr["source_trio"] = hl.struct(**tm.col)
      tm = tm.select_cols(**select_cols_expr)
  
      mt = tm.explode_cols(tm.__trio_members)
  
      mt = mt.transmute_entries(
          **mt.__trio_entries[mt.__trio_members[0]]
      )
  
      mt = mt.key_cols_by()
      mt = mt.transmute_cols(**mt.__trio_members[1])
  
      if col_keys:
          mt = mt.key_cols_by(*col_keys)
  
      return mt
  
imports: import hail
  from hail.typecheck import typecheck, sequenceof
  from hail.expr.expressions import expr_str, expr_call, expr_locus, expr_array
  from typing import List
label_desc: Use image node_id 3 for calling a global function with example usage: explode_trio_matrix(tm, col_keys, keep_trio_cols, keep_trio_entries) and returns: mt