code: def test_LinearRegression_err():
      """
      Test that errors are correctly accounted for
      By comparing to scikit-learn LinearRegression
      """
      np.random.seed(0)
      X = np.random.random((10, 1))
      y = np.random.random(10) + 1
      dy = 0.1
  
      y = np.random.normal(y, dy)
  
      clf1 = LinearRegression().fit(X, y, dy)
      clf2 = skLinearRegression().fit(X / dy, y / dy)
  
      assert_allclose(clf1.coef_[1:], clf2.coef_)
      assert_allclose(clf1.coef_[0], clf2.intercept_ * dy)
  
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 4 for calling a global function with example usage: test_LinearRegression_err() without return types