code: def validate_all(prefix, ignore_deprecated=False):
      """
      Execute the validation of all docstrings, and return a dict with the
      results.
  
      Parameters
      ----------
      prefix : str or None
          If provided, only the docstrings that start with this pattern will be
          validated. If None, all docstrings will be validated.
      ignore_deprecated: bool, default False
          If True, deprecated objects are ignored when validating docstrings.
  
      Returns
      -------
      dict
          A dictionary with an item for every function/method... containing
          all the validation information.
      """
      result = {}
      seen = {}
  
      # functions from the API docs
      api_doc_fnames = os.path.join(
          BASE_PATH, "docs", "source", "*.rst"
      )
      api_items = []
      for api_doc_fname in glob.glob(api_doc_fnames):
          if "sandbox" in api_doc_fname:
              continue
          with open(api_doc_fname, encoding="utf8") as f:
              api_items += list(get_api_items(f))
      for func_name, func_obj, section, subsection in api_items:
          if prefix and not func_name.startswith(prefix):
              continue
          doc_info = validate_one(func_name)
          if ignore_deprecated and doc_info["deprecated"]:
              continue
          result[func_name] = doc_info
  
          shared_code_key = doc_info["file"], doc_info["file_line"]
          shared_code = seen.get(shared_code_key, "")
          result[func_name].update(
              {
                  "in_api": True,
                  "section": section,
                  "subsection": subsection,
                  "shared_code_with": shared_code,
              }
          )
  
          seen[shared_code_key] = func_name
      # functions from introspecting Series and DataFrame
      api_item_names = set(list(zip(*api_items))[0])
      for class_name, class_ in API_CLASSES:
          for member in inspect.getmembers(class_):
              func_name = class_name + "." + member[0]
              if (
                  not member[0].startswith("_")
                  and func_name not in api_item_names
              ):
                  if prefix and not func_name.startswith(prefix):
                      continue
                  doc_info = validate_one(func_name)
                  if ignore_deprecated and doc_info["deprecated"]:
                      continue
                  result[func_name] = doc_info
                  result[func_name]["in_api"] = False
  
      return result
  
imports: import argparse
  import ast
  import collections
  import doctest
  import functools
  import glob
  import importlib
  import inspect
  from io import StringIO
  import json
  import os
  import pydoc
  import re
  import string
  import sys
  import tempfile
  import textwrap
  import flake8.main.application
  import matplotlib
  import numpy
  from numpydoc.docscrape import NumpyDocString
  import pandas
  from pandas.io.formats.printing import pprint_thing
  import statsmodels.api
label_desc: Use image node_id 5 for calling a global function with example usage: validate_all(prefix, ignore_deprecated) and returns: result