code: def _make_tsm_from_call(
      call_expr,
      block_size,
      *,
      mean_center=False,
      hwe_normalize=False,
      partition_size=None,
      whiten_window_size=None,
      whiten_block_size=64,
      normalize_after_whiten=False,
  ):
      mt = matrix_table_source("_make_tsm/entry_expr", call_expr)
      mt = mt.select_entries(__gt=call_expr.n_alt_alleles())
      if mean_center or hwe_normalize:
          mt = mt.annotate_rows(
              __AC=agg.sum(mt.__gt),
              __n_called=agg.count_where(hl.is_defined(mt.__gt)),
          )
          mt = mt.filter_rows(
              (mt.__AC > 0) & (mt.__AC < 2 * mt.__n_called)
          )
  
          n_variants = mt.count_rows()
          if n_variants == 0:
              raise FatalError(
                  "_make_tsm: found 0 variants after filtering out monomorphic sites."
              )
          info(
              f"_make_tsm: found {n_variants} variants after filtering out monomorphic sites."
          )
  
          mt = mt.annotate_rows(__mean_gt=mt.__AC / mt.__n_called)
          mt = mt.unfilter_entries()
  
          mt = mt.select_entries(
              __x=hl.or_else(mt.__gt - mt.__mean_gt, 0.0)
          )
  
          if hwe_normalize:
              mt = mt.annotate_rows(
                  __hwe_scaled_std_dev=hl.sqrt(
                      mt.__mean_gt * (2 - mt.__mean_gt) / 2
                  )
              )
              mt = mt.select_entries(
                  __x=mt.__x / mt.__hwe_scaled_std_dev
              )
      else:
          mt = mt.select_entries(__x=mt.__gt)
  
      return _make_tsm(
          mt.__x,
          block_size,
          partition_size=partition_size,
          whiten_window_size=whiten_window_size,
          whiten_block_size=whiten_block_size,
          normalize_after_whiten=normalize_after_whiten,
      )
  
imports: from typing import List, Tuple
  import hail
  import hail.expr.aggregators
  from hail.expr.expressions import construct_expr
  from hail.expr import expr_float64, expr_call, raise_unless_entry_indexed, matrix_table_source
  from hail import ir
  from hail.table import Table
  from hail.typecheck import typecheck, oneof, nullable
  from hail.utils import FatalError
  from hail.utils.java import Env, info
  from hail.experimental import mt_to_table_of_ndarray
label_desc: Use image node_id 5 for calling a global function with example usage: _make_tsm_from_call(call_expr, block_size) and returns: _make_tsm