code: def test_error_transform_diag(N=20, rseed=0):
      rng = np.random.RandomState(rseed)
      X = rng.rand(N, 2)
      yerr = 0.05 * (1 + rng.rand(N))
      y = (X[:, 0] ** 2 + X[:, 1]) + yerr * rng.randn(N)
      Sigma = np.eye(N) * yerr**2
  
      X1, y1 = LinearRegression._scale_by_error(X, y, yerr)
      X2, y2 = LinearRegression._scale_by_error(X, y, Sigma)
  
      assert_allclose(X1, X2)
      assert_allclose(y1, y2)
  
file_path: astroML/astroML/linear_model/tests/test_linear_regression.py
imports: import pytest
  import numpy
  from numpy.testing import assert_allclose
  from sklearn.linear_model import LinearRegression
  from astroML.linear_model import LinearRegression, PolynomialRegression, BasisFunctionRegression
label_desc: Use image node_id 1 for calling a global function with example usage: test_error_transform_diag(N, rseed) without return types