code: def test_base_subclass_init_matches_docs(child_class: str):
      """
      This test is comparing the docstrings for arguments in __init__ for any
      class that derives from `Base`, We ensure that 1) the base arguments exist
      in the derived class, 2) The types and default values are the same and 3)
      That the docstring matches the base class
  
      This is to prevent multiple different docstrings for identical arguments
      throughout the documentation
  
      Parameters
      ----------
      child_class : str
          Classname to test in the dict all_base_children
  
      """
      klass = all_base_children[child_class]
  
      if issubclass(klass, sklBaseEstimator):
          pytest.skip(
              "Preprocessing models do not have "
              "the base arguments in constructors."
          )
  
      # To quickly find and replace all instances in the documentation, the below
      # regex's may be useful
      # output_type: r"^[ ]{4}output_type :.*\n(^(?![ ]{0,4}(?![ ]{4,})).*(\n))+"
      # verbose: r"^[ ]{4}verbose :.*\n(^(?![ ]{0,4}(?![ ]{4,})).*(\n))+"
      # handle: r"^[ ]{4}handle :.*\n(^(?![ ]{0,4}(?![ ]{4,})).*(\n))+"
  
      def get_param_doc(param_doc_obj, name: str):
          found_doc = next(
              (x for x in param_doc_obj if x.name == name), None
          )
  
          assert (
              found_doc is not None
          ), "Could not find {} in docstring".format(name)
  
          return found_doc
  
      # Load the base class signature, parse the docstring and pull out params
      base_sig = inspect.signature(cuml.Base, follow_wrapped=True)
      base_doc = numpydoc.docscrape.NumpyDocString(cuml.Base.__doc__)
      base_doc_params = base_doc["Parameters"]
  
      # Load the current class signature, parse the docstring and pull out params
      klass_sig = inspect.signature(klass, follow_wrapped=True)
      klass_doc = numpydoc.docscrape.NumpyDocString(klass.__doc__ or "")
      klass_doc_params = klass_doc["Parameters"]
  
      for name, param in base_sig.parameters.items():
          if param.name == "output_mem_type":
              continue  # TODO(wphicks): Add this to all algos
          # Ensure the base param exists in the derived
          assert param.name in klass_sig.parameters
  
          klass_param = klass_sig.parameters[param.name]
  
          # Ensure the default values are the same
          assert param.default == klass_param.default
  
          # Make sure we aren't accidentally a *args or **kwargs
          assert (
              klass_param.kind
              == inspect.Parameter.POSITIONAL_OR_KEYWORD
              or klass_param.kind == inspect.Parameter.KEYWORD_ONLY
          )
  
          if klass.__doc__ is not None:
              found_doc = get_param_doc(klass_doc_params, name)
  
              base_item_doc = get_param_doc(base_doc_params, name)
  
              # Ensure the docstring is identical
              assert (
                  found_doc.type == base_item_doc.type
              ), "Docstring mismatch for {}".format(name)
  
              assert " ".join(found_doc.desc) == " ".join(
                  base_item_doc.desc
              )
  
file_path: cuml/python/cuml/tests/test_base.py
imports: import inspect
  import cuml
  import pytest
  import numpydoc.docscrape
  from pylibraft.common.cuda import Stream
  from cuml.testing.utils import get_classes_from_package, small_classification_dataset
  from cuml._thirdparty.sklearn.utils.skl_dependencies import BaseEstimator
label_desc: Use image node_id 5 for calling a global function with example usage: test_base_subclass_init_matches_docs(child_class) and returns: found_doc