code: def realized_relationship_matrix(call_expr) -> BlockMatrix:
      r"""Computes the realized relationship matrix (RRM).
  
      Examples
      --------
  
      >>> rrm = hl.realized_relationship_matrix(dataset.GT)
  
      Notes
      -----
      The realized relationship matrix (RRM) is defined as follows. Consider the
      :math:`n \times m` matrix :math:`C` of raw genotypes, with rows indexed by
      :math:`n` samples and columns indexed by the :math:`m` bialellic autosomal
      variants; :math:`C_{ij}` is the number of alternate alleles of variant
      :math:`j` carried by sample :math:`i`, which can be 0, 1, 2, or missing. For
      each variant :math:`j`, the sample alternate allele frequency :math:`p_j` is
      computed as half the mean of the non-missing entries of column :math:`j`.
      Entries of :math:`M` are then mean-centered and variance-normalized as
  
      .. math::
  
          M_{ij} =
            \frac{C_{ij}-2p_j}
                  {\sqrt{\frac{m}{n} \sum_{k=1}^n (C_{ij}-2p_j)^2}},
  
      with :math:`M_{ij} = 0` for :math:`C_{ij}` missing (i.e. mean genotype
      imputation). This scaling normalizes each variant column to have empirical
      variance :math:`1/m`, which gives each sample row approximately unit total
      variance (assuming linkage equilibrium) and yields the :math:`n \times n`
      sample correlation or realized relationship matrix (RRM) :math:`K` as simply
  
      .. math::
  
          K = MM^T
  
      Note that the only difference between the realized relationship matrix and
      the genetic relatedness matrix (GRM) used in
      :func:`.realized_relationship_matrix` is the variant (column) normalization:
      where RRM uses empirical variance, GRM uses expected variance under
      Hardy-Weinberg Equilibrium.
  
      This method drops variants with zero variance before computing kinship.
  
      Parameters
      ----------
      call_expr : :class:`.CallExpression`
          Entry-indexed call expression on matrix table with columns corresponding
          to samples.
  
      Returns
      -------
      :class:`.BlockMatrix`
          Realized relationship matrix for all samples. Row and column indices
          correspond to matrix table column index.
      """
      mt = matrix_table_source(
          "realized_relationship_matrix/call_expr", call_expr
      )
      raise_unless_entry_indexed(
          "realized_relationship_matrix/call_expr", call_expr
      )
  
      mt = mt.select_entries(
          __gt=call_expr.n_alt_alleles()
      ).unfilter_entries()
      mt = mt.select_rows(
          __AC=agg.sum(mt.__gt),
          __ACsq=agg.sum(mt.__gt * mt.__gt),
          __n_called=agg.count_where(hl.is_defined(mt.__gt)),
      )
      mt = mt.select_rows(
          __mean_gt=mt.__AC / mt.__n_called,
          __centered_length=hl.sqrt(
              mt.__ACsq - (mt.__AC**2) / mt.__n_called
          ),
      )
      fmt = mt.filter_rows(
          mt.__centered_length > 0.1
      )  # truly non-zero values are at least sqrt(0.5)
  
      normalized_gt = hl.or_else(
          (fmt.__gt - fmt.__mean_gt) / fmt.__centered_length, 0.0
      )
  
      try:
          bm = BlockMatrix.from_entry_expr(normalized_gt)
          return (bm.T @ bm) / (bm.n_rows / bm.n_cols)
      except FatalError as fe:
          raise FatalError(
              "Could not convert MatrixTable to BlockMatrix. It's possible all variants were dropped by variance filter.\n"
              "Check that the input MatrixTable has at least two samples in it:  mt.count_cols()."
          ) from fe
  
imports: import builtins
  import itertools
  import math
  from typing import Dict, Callable, Optional, Union, Tuple, List
  import hail
  import hail
  import hail.expr.aggregators
  from hail import ir
  from hail.expr import Expression, ExpressionException, expr_float64, expr_call, expr_any, expr_numeric, expr_locus, analyze, raise_unless_entry_indexed, raise_unless_row_indexed, matrix_table_source, table_source, raise_unless_column_indexed
  from hail.expr.types import tbool, tarray, tfloat64, tint32
  from hail.genetics.reference_genome import reference_genome_type
  from hail.linalg import BlockMatrix
  from hail.matrixtable import MatrixTable
  from hail.methods.misc import require_biallelic, require_row_key_variant
  from hail.stats import LinearMixedModel
  from hail.table import Table
  from hail.typecheck import typecheck, nullable, numeric, oneof, sized_tupleof, sequenceof, enumeration, anytype
  from hail.utils import wrap_to_list, new_temp_file, FatalError
  from hail.utils.java import Env, info, warning
  from .None import pca
  from .None import relatedness
  from ..backend.spark_backend import SparkBackend
label_desc: Use image node_id 29 for calling a global function with example usage: realized_relationship_matrix(call_expr) and returns: unknown