docstr: %autoreload => Reload modules automatically
  
  %autoreload
  Reload all modules (except those excluded by %aimport) automatically
  now.
  
  %autoreload 0
  Disable automatic reloading.
  
  %autoreload 1
  Reload all modules imported with %aimport every time before executing
  the Python code typed.
  
  %autoreload 2
  Reload all modules (except those excluded by %aimport) every time
  before executing the Python code typed.
  
  Reloading Python modules in a reliable way is in general
  difficult, and unexpected things may occur. %autoreload tries to
  work around common pitfalls by replacing function code objects and
  parts of classes previously in the module with new versions. This
  makes the following things to work:
  
  - Functions and classes imported via 'from xxx import foo' are upgraded
    to new versions when 'xxx' is reloaded.
  
  - Methods and properties of classes are upgraded on reload, so that
    calling 'c.foo()' on an object 'c' created before the reload causes
    the new code for 'foo' to be executed.
  
  Some of the known remaining caveats are:
  
  - Replacing code objects does not always succeed: changing a @property
    in a class to an ordinary method or a method to a member variable
    can cause problems (but in old objects only).
  
  - Functions that are removed (eg. via monkey-patching) from a module
    before it is reloaded are not upgraded.
  
  - C extension modules cannot be reloaded, and so cannot be
    autoreloaded.
docstr_tok: ["%","autoreload","=",">","Reload","modules","automatically","%","autoreload","Reload","all","modules","(","except","those","excluded","by","%","aimport",")","automatically","now",".","%","autoreload","0","Disable","automatic","reloading",".","%","autoreload","1","Reload","all","modules","imported","with","%","aimport","every","time","before","executing","the","Python","code","typed",".","%","autoreload","2","Reload","all","modules","(","except","those","excluded","by","%","aimport",")","every","time","before","executing","the","Python","code","typed",".","Reloading","Python","modules","in","a","reliable","way","is","in","general","difficult",",","and","unexpected","things","may","occur",".","%","autoreload","tries","to","work","around","common","pitfalls","by","replacing","function","code","objects","and","parts","of","classes","previously","in","the","module","with","new","versions",".","This","makes","the","following","things","to","work",":","-","Functions","and","classes","imported","via","'from","xxx","import","foo","'","are","upgraded","to","new","versions","when","'xxx","'","is","reloaded",".","-","Methods","and","properties","of","classes","are","upgraded","on","reload",",","so","that","calling","'","c.foo","(",")","'","on","an","object","'","c","'","created","before","the","reload","causes","the","new","code","for","'foo","'","to","be","executed",".","Some","of","the","known","remaining","caveats","are",":","-","Replacing","code","objects","does","not","always","succeed",":","changing","a","@","property","in","a","class","to","an","ordinary","method","or","a","method","to","a","member","variable","can","cause","problems","(","but","in","old","objects","only",")",".","-","Functions","that","are","removed","(","eg",".","via","monkey-patching",")","from","a","module","before","it","is","reloaded","are","not","upgraded",".","-","C","extension","modules","can","not","be","reloaded",",","and","so","can","not","be","autoreloaded","."]
code: def autoreload(self, parameter_s=""):
      r"""%autoreload => Reload modules automatically
  
      %autoreload
      Reload all modules (except those excluded by %aimport) automatically
      now.
  
      %autoreload 0
      Disable automatic reloading.
  
      %autoreload 1
      Reload all modules imported with %aimport every time before executing
      the Python code typed.
  
      %autoreload 2
      Reload all modules (except those excluded by %aimport) every time
      before executing the Python code typed.
  
      Reloading Python modules in a reliable way is in general
      difficult, and unexpected things may occur. %autoreload tries to
      work around common pitfalls by replacing function code objects and
      parts of classes previously in the module with new versions. This
      makes the following things to work:
  
      - Functions and classes imported via 'from xxx import foo' are upgraded
        to new versions when 'xxx' is reloaded.
  
      - Methods and properties of classes are upgraded on reload, so that
        calling 'c.foo()' on an object 'c' created before the reload causes
        the new code for 'foo' to be executed.
  
      Some of the known remaining caveats are:
  
      - Replacing code objects does not always succeed: changing a @property
        in a class to an ordinary method or a method to a member variable
        can cause problems (but in old objects only).
  
      - Functions that are removed (eg. via monkey-patching) from a module
        before it is reloaded are not upgraded.
  
      - C extension modules cannot be reloaded, and so cannot be
        autoreloaded.
  
      """
      if parameter_s == "":
          self._reloader.check(True)
      elif parameter_s == "0":
          self._reloader.enabled = False
      elif parameter_s == "1":
          self._reloader.check_all = False
          self._reloader.enabled = True
      elif parameter_s == "2":
          self._reloader.check_all = True
          self._reloader.enabled = True
  
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 2 for calling the AutoreloadMagics obj's underlying member method code with example usage: obj.autoreload(parameter_s) without return types