code: def test_has_intercept(newsgroups_train, clf, intercept):
      vec = TfidfVectorizer()
      X = vec.fit_transform(newsgroups_train[0])
      clf.fit(X, newsgroups_train[1])
      assert has_intercept(clf) == intercept
  
imports: from __future__ import absolute_import
  import numpy
  import pytest
  from sklearn.datasets import make_classification, make_regression
  from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
  from sklearn.linear_model import LogisticRegression, ElasticNet, SGDRegressor
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.linear_model import SGDClassifier
  from sklearn.naive_bayes import GaussianNB, BernoulliNB
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.multiclass import OneVsRestClassifier
  from eli5._feature_names import FeatureNames
  from eli5.sklearn.utils import get_feature_names, get_default_target_names, has_intercept, is_multiclass_classifier, is_multitarget_regressor, get_num_features
  from .utils import SGD_KWARGS
label_desc: Use image node_id 1 for calling a global function with example usage: test_has_intercept(newsgroups_train, clf, intercept) without return types