code: def test_lime_flat_neighbourhood(newsgroups_train):
      docs, y, target_names = newsgroups_train
      doc = docs[0]
  
      @_apply_to_list
      def predict_proba(doc):
          """This function predicts non-zero probabilities only for 3 labels"""
          proba_graphics = [0, 1.0, 0, 0]
          proba_other = [0.9, 0, 0.1, 0]
          return proba_graphics if "file" in doc else proba_other
  
      te = TextExplainer(expand_factor=None, random_state=42)
      te.fit(doc, predict_proba)
      print(te.metrics_)
      print(te.clf_.classes_, target_names)
  
      res = te.explain_prediction(top=20, target_names=target_names)
      for expl in format_as_all(res, te.clf_):
          assert "file" in expl
          assert "comp.graphics" in expl
  
file_path: eli5/tests/test_lime.py
imports: from __future__ import absolute_import
  import numpy
  from sklearn.feature_extraction.text import HashingVectorizer, CountVectorizer
  from sklearn.naive_bayes import MultinomialNB
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.pipeline import make_pipeline
  import pytest
  from eli5.lime import TextExplainer
  from eli5.formatters import format_as_text
  from .utils import format_as_all, check_targets_scores
label_desc: Use image node_id 2 for calling a global function with example usage: test_lime_flat_neighbourhood(newsgroups_train) and returns: unknown