code: def all_classes(
      return_private=False,
      modules_to_ignore=None,
      modules_to_consider=None,
  ):
      """Get a list of all classes from nilearn.
  
      This function returns a list of all classes defined in Nilearn.
  
      .. note::
  
          ``modules_to_ignore`` and ``modules_to_consider`` cannot
          be specified simultaneously.
  
      Parameters
      ----------
      return_private : :obj:`bool`, default=False
          Whether to return also private classes or not.
  
      modules_to_ignore : :obj:`list` or :obj:`set` of :obj:`str` or None,\
                          default=None
          List of modules to exclude from the listing.
  
          .. note::
  
              This function will not list classes from
              ``tests``, ``externals``, and ``data`` by default.
  
      modules_to_consider : :obj:`list` or :obj:`set` of :obj:`str` or None,\
                            default=None
          List of modules to consider for the listing.
  
      Returns
      -------
      all_classes : List of Tuples (:obj:`str`, callable)
          List of classes.
          Each element is a length 2 tuple
          where the first element is the class name as a string,
          and the second element is the class itself.
      """
      all_classes = []
      modules = all_modules(
          modules_to_ignore=modules_to_ignore,
          modules_to_consider=modules_to_consider,
      )
      for modname in modules:
          module = import_module(modname)
          classes = [
              (name, cls)
              for name, cls in inspect.getmembers(
                  module, inspect.isclass
              )
              if cls.__module__ == module.__name__
          ]
          if not return_private:
              classes = [
                  (name, cls)
                  for name, cls in classes
                  if not name.startswith("_")
              ]
          all_classes.extend(classes)
      return all_classes
  
file_path: nilearn/nilearn/_utils/__init__.py
imports: import inspect
  import pkgutil
  import warnings
  from importlib import import_module
  from pathlib import Path
  from nilearn._utils.helpers import compare_version, remove_parameters, rename_parameters, stringify_path
  from .cache_mixin import CacheMixin
  from .docs import fill_doc
  from .logger import compose_err_msg
  from .niimg import _repr_niimgs, load_niimg
  from .niimg_conversions import check_niimg, check_niimg_3d, check_niimg_4d
  from .numpy_conversions import as_ndarray
label_desc: Use image node_id 3 for calling a global function with example usage: all_classes(return_private, modules_to_ignore, modules_to_consider) and returns: all_classes