code: def solve_helper(nd_coef, nd_dep, nd_dep_ndim_orig):
      assert nd_coef.ndim == 2
      assert nd_dep_ndim_orig == 1 or nd_dep_ndim_orig == 2
  
      if nd_dep_ndim_orig == 1:
          nd_dep = nd_dep.reshape((-1, 1))
  
      if nd_coef.dtype.element_type != hl.tfloat64:
          nd_coef = nd_coef.map(lambda e: hl.float64(e))
      if nd_dep.dtype.element_type != hl.tfloat64:
          nd_dep = nd_dep.map(lambda e: hl.float64(e))
      return nd_coef, nd_dep
  
imports: from functools import reduce
  import hail
  from hail.expr.functions import _ndarray
  from hail.expr.functions import array
  from hail.expr.types import HailType, tfloat64, tfloat32, ttuple, tndarray
  from hail.typecheck import typecheck, nullable, oneof, tupleof, sequenceof
  from hail.expr.expressions import expr_int32, expr_int64, expr_tuple, expr_any, expr_array, expr_ndarray, expr_numeric, Int64Expression, cast_expr, construct_expr, expr_bool, unify_all
  from hail.expr.expressions.typed_expressions import NDArrayNumericExpression
  from hail.ir import NDArrayQR, NDArrayInv, NDArrayConcat, NDArraySVD, NDArrayEigh, Apply
label_desc: Use image node_id 10 for calling a global function with example usage: solve_helper(nd_coef, nd_dep, nd_dep_ndim_orig) and returns: nd_coef,  nd_dep