code: def _get_regression_row_fields(
      mt, pass_through, method
  ) -> Dict[str, str]:
      row_fields = dict(zip(mt.row_key.keys(), mt.row_key.keys()))
      for f in pass_through:
          if isinstance(f, str):
              if f not in mt.row:
                  raise ValueError(
                      f"'{method}/pass_through': MatrixTable has no row field {repr(f)}"
                  )
              if f in row_fields:
                  # allow silent pass through of key fields
                  if f in mt.row_key:
                      pass
                  else:
                      raise ValueError(
                          f"'{method}/pass_through': found duplicated field {repr(f)}"
                      )
              row_fields[f] = mt[f]
          else:
              assert isinstance(f, Expression)
              if not f._ir.is_nested_field:
                  raise ValueError(
                      f"'{method}/pass_through': expect fields or nested fields, not complex expressions"
                  )
              if not f._indices == mt._row_indices:
                  raise ExpressionException(
                      f"'{method}/pass_through': require row-indexed fields, found indices {f._indices.axes}"
                  )
              name = f._ir.name
              if name in row_fields:
                  # allow silent pass through of key fields
                  if not (name in mt.row_key and f._ir == mt[name]._ir):
                      raise ValueError(
                          f"'{method}/pass_through': found duplicated field {repr(name)}"
                      )
              row_fields[name] = f
      for k in mt.row_key:
          del row_fields[k]
      return row_fields
  
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 2 for calling a global function with example usage: _get_regression_row_fields(mt, pass_through, method) and returns: row_fields