code: def _gram(M: BlockMatrix) -> BlockMatrix:
      """Compute Gram matrix, `M.T @ M`.
  
      Parameters
      ----------
      M : :class:`.BlockMatrix`
  
      Returns
      -------
      :class:`.BlockMatrix`
          `M.T @ M`
      """
      return (M.T @ M).checkpoint(
          new_temp_file("pc_relate_bm/gram", "bm")
      )
  
imports: from typing import Optional
  import hail
  import hail.expr.aggregators
  from hail import ir
  from hail.backend.spark_backend import SparkBackend
  from hail.expr import ArrayNumericExpression, BooleanExpression, CallExpression, Float64Expression, analyze, expr_array, expr_call, expr_float64, matrix_table_source
  from hail.expr.types import tarray
  from hail.linalg import BlockMatrix
  from hail.table import Table
  from hail.typecheck import enumeration, nullable, numeric, typecheck
  from hail.utils import new_temp_file
  from hail.utils.java import Env
  from ..pca import _hwe_normalized_blanczos, hwe_normalized_pca
label_desc: Use image node_id 3 for calling a global function with example usage: _gram(M) and returns: unknown