code: def row_correlation(entry_expr, block_size=None) -> BlockMatrix:
      """Computes the correlation matrix between row vectors.
  
      Examples
      --------
      Consider the following dataset with three variants and four samples:
  
      >>> data = [{'v': '1:1:A:C', 's': 'a', 'GT': hl.Call([0, 0])},
      ...         {'v': '1:1:A:C', 's': 'b', 'GT': hl.Call([0, 0])},
      ...         {'v': '1:1:A:C', 's': 'c', 'GT': hl.Call([0, 1])},
      ...         {'v': '1:1:A:C', 's': 'd', 'GT': hl.Call([1, 1])},
      ...         {'v': '1:2:G:T', 's': 'a', 'GT': hl.Call([0, 1])},
      ...         {'v': '1:2:G:T', 's': 'b', 'GT': hl.Call([1, 1])},
      ...         {'v': '1:2:G:T', 's': 'c', 'GT': hl.Call([0, 1])},
      ...         {'v': '1:2:G:T', 's': 'd', 'GT': hl.Call([0, 0])},
      ...         {'v': '1:3:C:G', 's': 'a', 'GT': hl.Call([0, 1])},
      ...         {'v': '1:3:C:G', 's': 'b', 'GT': hl.Call([0, 0])},
      ...         {'v': '1:3:C:G', 's': 'c', 'GT': hl.Call([1, 1])},
      ...         {'v': '1:3:C:G', 's': 'd', 'GT': hl.missing(hl.tcall)}]
      >>> ht = hl.Table.parallelize(data, hl.dtype('struct{v: str, s: str, GT: call}'))
      >>> mt = ht.to_matrix_table(row_key=['v'], col_key=['s'])
  
      Compute genotype correlation between all pairs of variants:
  
      >>> ld = hl.row_correlation(mt.GT.n_alt_alleles())
      >>> ld.to_numpy()
      array([[ 1.        , -0.85280287,  0.42640143],
             [-0.85280287,  1.        , -0.5       ],
             [ 0.42640143, -0.5       ,  1.        ]])
  
      Compute genotype correlation between consecutively-indexed variants:
  
      >>> ld.sparsify_band(lower=0, upper=1).to_numpy()
      array([[ 1.        , -0.85280287,  0.        ],
             [ 0.        ,  1.        , -0.5       ],
             [ 0.        ,  0.        ,  1.        ]])
  
      Warning
      -------
      Rows with a constant value (i.e., zero variance) will result `nan`
      correlation values. To avoid this, first check that all rows vary or filter
      out constant rows (for example, with the help of :func:`.aggregators.stats`).
  
      Notes
      -----
      In this method, each row of entries is regarded as a vector with elements
      defined by `entry_expr` and missing values mean-imputed per row.
      The ``(i, j)`` element of the resulting block matrix is the correlation
      between rows ``i`` and ``j`` (as 0-indexed by order in the matrix table;
      see :meth:`~hail.MatrixTable.add_row_index`).
  
      The correlation of two vectors is defined as the
      `Pearson correlation coeffecient <https://en.wikipedia.org/wiki/Pearson_correlation_coefficient>`__
      between the corresponding empirical distributions of elements,
      or equivalently as the cosine of the angle between the vectors.
  
      This method has two stages:
  
      - writing the row-normalized block matrix to a temporary file on persistent
        disk with :meth:`.BlockMatrix.from_entry_expr`. The parallelism is
        ``n_rows / block_size``.
  
      - reading and multiplying this block matrix by its transpose. The
        parallelism is ``(n_rows / block_size)^2`` if all blocks are computed.
  
      Warning
      -------
      See all warnings on :meth:`.BlockMatrix.from_entry_expr`. In particular,
      for large matrices, it may be preferable to run the two stages separately,
      saving the row-normalized block matrix to a file on external storage with
      :meth:`.BlockMatrix.write_from_entry_expr`.
  
      The resulting number of matrix elements is the square of the number of rows
      in the matrix table, so computing the full matrix may be infeasible. For
      example, ten million rows would produce 800TB of float64 values. The
      block-sparse representation on BlockMatrix may be used to work efficiently
      with regions of such matrices, as in the second example above and
      :meth:`ld_matrix`.
  
      To prevent excessive re-computation, be sure to write and read the (possibly
      block-sparsified) result before multiplication by another matrix.
  
      Parameters
      ----------
      entry_expr : :class:`.Float64Expression`
          Entry-indexed numeric expression on matrix table.
      block_size : :obj:`int`, optional
          Block size. Default given by :meth:`.BlockMatrix.default_block_size`.
  
      Returns
      -------
      :class:`.BlockMatrix`
          Correlation matrix between row vectors. Row and column indices
          correspond to matrix table row index.
      """
      bm = BlockMatrix.from_entry_expr(
          entry_expr,
          mean_impute=True,
          center=True,
          normalize=True,
          block_size=block_size,
      )
      return bm @ bm.T
  
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 30 for calling a global function with example usage: row_correlation(entry_expr, block_size) and returns: unknown