code: def test_LinearRegressionwithErrors():
      """
      Test for small errors agrees with fit with y errors only
      """
  
      from astroML.linear_model import LinearRegressionwithErrors
  
      np.random.seed(0)
      X = np.random.random(10) + 1
      dy = np.random.random(10) * 0.1
      y = X * 2 + 1 + (dy - 0.05)
      dx = np.random.random(10) * 0.01
      X = X + (dx - 0.005)
  
      clf1 = LinearRegression().fit(X[:, None], y, dy)
      clf2 = LinearRegressionwithErrors().fit(
          np.atleast_2d(X), y, dy, dx
      )
  
      assert_allclose(clf1.coef_, clf2.coef_, 0.2)
  
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 8 for calling a global function with example usage: test_LinearRegressionwithErrors() without return types