class_docstr: Adapted from docutils/parsers/rst/directives/admonitions.py
  
  Uses a default text if the directive does not have contents. If it does,
  the default text is concatenated to the contents.
code: def run(self):
      try:
          obj = self.arguments[0]
      except IndexError:
          # Argument is empty; use default text
          obj = "submodule"
      text = (
          f"This {obj} is considered legacy and will no longer receive "
          "updates. This could also mean it will be removed in future "
          "SciPy versions."
      )
  
      try:
          self.content[0] = text + " " + self.content[0]
      except IndexError:
          # Content is empty; use the default text
          source, lineno = self.state_machine.get_source_and_line(
              self.lineno
          )
          self.content.append(text, source=source, offset=lineno)
      text = "\n".join(self.content)
      # Create the admonition node, to be populated by `nested_parse`
      admonition_node = self.node_class(rawsource=text)
      # Set custom title
      title_text = "Legacy"
      textnodes, _ = self.state.inline_text(title_text, self.lineno)
      title = nodes.title(title_text, "", *textnodes)
      # Set up admonition node
      admonition_node += title
      # Select custom class for CSS styling
      admonition_node["classes"] = ["admonition-legacy"]
      # Parse the directive contents
      self.state.nested_parse(
          self.content, self.content_offset, admonition_node
      )
      return [admonition_node]
  
imports: import math
  import os
  from os.path import relpath, dirname
  import re
  import sys
  import warnings
  from datetime import date
  from docutils import nodes
  from docutils.parsers.rst import Directive
  import matplotlib
  import matplotlib.pyplot
  from numpydoc.docscrape_sphinx import SphinxDocString
  from sphinx.util import inspect
  import scipy
  from scipy._lib._util import _rng_html_rewrite
  import scipy._lib.uarray
  from scipy.stats._distn_infrastructure import rv_generic
  from scipy.stats._multivariate import multi_rv_generic
  import numpydoc.docscrape
  import inspect
label_desc: Use image node_id 1 for calling the LegacyDirective obj's underlying member method code with example usage: obj.run() and returns: list