code: def notebook_modification_function(
      notebook_content, notebook_filename
  ):
      notebook_content_str = str(notebook_content)
      warning_template = "\n".join(
          [
              "<div class='alert alert-{message_class}'>",
              "",
              "# JupyterLite warning",
              "",
              "{message}",
              "</div>",
          ]
      )
  
      message_class = "warning"
      message = (
          "Running the scikit-learn examples in JupyterLite is experimental and you may"
          " encounter some unexpected behavior.\n\nThe main difference is that imports"
          " will take a lot longer than usual, for example the first `import sklearn` can"
          " take roughly 10-20s.\n\nIf you notice problems, feel free to open an"
          " [issue](https://github.com/scikit-learn/scikit-learn/issues/new/choose)"
          " about it."
      )
  
      markdown = warning_template.format(
          message_class=message_class, message=message
      )
  
      dummy_notebook_content = {"cells": []}
      add_markdown_cell(dummy_notebook_content, markdown)
  
      code_lines = []
  
      if "seaborn" in notebook_content_str:
          code_lines.append("%pip install seaborn")
      if "plotly.express" in notebook_content_str:
          code_lines.append("%pip install plotly")
      if "skimage" in notebook_content_str:
          code_lines.append("%pip install scikit-image")
      if "fetch_" in notebook_content_str:
          code_lines.extend(
              [
                  "%pip install pyodide-http",
                  "import pyodide_http",
                  "pyodide_http.patch_all()",
              ]
          )
      # always import matplotlib and pandas to avoid Pyodide limitation with
      # imports inside functions
      code_lines.extend(["import matplotlib", "import pandas"])
  
      if code_lines:
          code_lines = ["# JupyterLite-specific code"] + code_lines
          code = "\n".join(code_lines)
          add_code_cell(dummy_notebook_content, code)
  
      notebook_content["cells"] = (
          dummy_notebook_content["cells"] + notebook_content["cells"]
      )
  
imports: import os
  import re
  import sys
  import warnings
  from datetime import datetime
  from io import StringIO
  from pathlib import Path
  from sklearn.externals._packaging.version import parse
  import sphinx_gallery
  from github_link import make_linkcode_resolve
  from sphinx_gallery.notebook import add_code_cell, add_markdown_cell
  from sphinx_gallery.sorting import ExampleTitleSortKey
  import sklearn
  from sklearn.experimental import enable_iterative_imputer
  from sklearn.experimental import enable_halving_search_cv
  from sklearn.utils.fixes import VisibleDeprecationWarning
label_desc: Use image node_id 1 for calling a global function with example usage: notebook_modification_function(notebook_content, notebook_filename) without return types