docstr: Check whether some modules need to be reloaded.
docstr_tok: ["Check","whether","some","modules","need","to","be","reloaded","."]
code: def check(self, check_all=False, do_reload=True):
      """Check whether some modules need to be reloaded."""
  
      if not self.enabled and not check_all:
          return
  
      if check_all or self.check_all:
          modules = list(sys.modules.keys())
      else:
          modules = list(self.modules.keys())
  
      for modname in modules:
          m = sys.modules.get(modname, None)
  
          if modname in self.skip_modules:
              continue
  
          py_filename, pymtime = self.filename_and_mtime(m)
          if py_filename is None:
              continue
  
          try:
              if pymtime <= self.modules_mtimes[modname]:
                  continue
          except KeyError:
              self.modules_mtimes[modname] = pymtime
              continue
          else:
              if self.failed.get(py_filename, None) == pymtime:
                  continue
  
          self.modules_mtimes[modname] = pymtime
  
          # If we've reached this point, we should try to reload the module
          if do_reload:
              self._report(f"Reloading '{modname}'.")
              try:
                  if self.autoload_obj:
                      superreload(
                          m, reload, self.old_objects, self.shell
                      )
                  else:
                      superreload(m, reload, self.old_objects)
                  if py_filename in self.failed:
                      del self.failed[py_filename]
              except:
                  if not self.hide_errors:
                      print(
                          "[autoreload of {} failed: {}]".format(
                              modname, traceback.format_exc(10)
                          ),
                          file=sys.stderr,
                      )
                  self.failed[py_filename] = pymtime
  
imports: from IPython.core import magic_arguments
  from IPython.core.magic import Magics, magics_class, line_magic
  import os
  import sys
  import traceback
  import types
  import weakref
  import gc
  import logging
  from importlib import import_module, reload
  from importlib.util import source_from_cache
label_desc: Use image node_id 6 for calling the ModuleReloader obj's underlying member method code with example usage: obj.check(check_all, do_reload) without return types