code: def residualize(Y, X):
      filled = np.nan_to_num(Y)
      coef = np.linalg.lstsq(X, filled, rcond=None)[0]
      pred = X @ coef
      return Y - pred
  
imports: import functions
  import numpy
  import statsmodels.api
  import pandas
  import glow.gwas.functions
  import glow.gwas.lin_reg
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: residualize(Y, X) and returns: unknown