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:
              try:
                  superreload(m, reload, self.old_objects)
                  if py_filename in self.failed:
                      del self.failed[py_filename]
              except:
                  print(
                      "[autoreload of %s failed: %s]"
                      % (modname, traceback.format_exc(1)),
                      file=sys.stderr,
                  )
                  self.failed[py_filename] = pymtime
  
imports: from __future__ import print_function
  import os
  import sys
  import traceback
  import types
  import weakref
  from IPython.utils import openpy
  from IPython.utils.py3compat import PY3
  from IPython.core.magic import Magics, magics_class, line_magic
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