class_docstr: Magics to manage various aspects of the user's namespace.
  
  These include listing variables, introspecting into them, etc.
class_docstr_tok: ["Magics","to","manage","various","aspects","of","the","user","'s","namespace",".","These","include","listing","variables",",","introspecting","into","them",",","etc","."]
docstr: Resets the namespace by removing all names defined by the user, if
  called without arguments, or by removing some types of objects, such
  as everything currently in IPython's In[] and Out[] containers (see
  the parameters for details).
  
  Parameters
  ----------
  -f : force reset without asking for confirmation.
  
  -s : 'Soft' reset: Only clears your namespace, leaving history intact.
      References to objects may be kept. By default (without this option),
      we do a 'hard' reset, giving you a new session and removing all
      references to objects from the current session.
  
  in : reset input history
  
  out : reset output history
  
  dhist : reset directory history
  
  array : reset only variables that are NumPy arrays
  
  See Also
  --------
  reset_selective : invoked as ``%reset_selective``
  
  Examples
  --------
  ::
  
    In [6]: a = 1
  
    In [7]: a
    Out[7]: 1
  
    In [8]: 'a' in _ip.user_ns
    Out[8]: True
  
    In [9]: %reset -f
  
    In [1]: 'a' in _ip.user_ns
    Out[1]: False
  
    In [2]: %reset -f in
    Flushing input history
  
    In [3]: %reset -f dhist in
    Flushing directory history
    Flushing input history
  
  Notes
  -----
  Calling this magic from clients that do not implement standard input,
  such as the ipython notebook interface, will reset the namespace
  without confirmation.
docstr_tok: ["Resets","the","namespace","by","removing","all","names","defined","by","the","user",",","if","called","without","arguments",",","or","by","removing","some","types","of","objects",",","such","as","everything","currently","in","IPython","'s","In","[","]","and","Out","[","]","containers","(","see","the","parameters","for","details",")",".","Parameters","--","--","--","--","--","-f",":","force","reset","without","asking","for","confirmation",".","-s",":","'Soft","'","reset",":","Only","clears","your","namespace",",","leaving","history","intact",".","References","to","objects","may","be","kept",".","By","default","(","without","this","option",")",",","we","do","a","'hard","'","reset",",","giving","you","a","new","session","and","removing","all","references","to","objects","from","the","current","session",".","in",":","reset","input","history","out",":","reset","output","history","dhist",":","reset","directory","history","array",":","reset","only","variables","that","are","NumPy","arrays","See","Also","--","--","--","--","reset_selective",":","invoked","as","``","%","reset_selective","``","Examples","--","--","--","--",":",":","In","[","6","]",":","a","=","1","In","[","7","]",":","a","Out","[","7","]",":","1","In","[","8","]",":","'","a","'","in","_ip.user_ns","Out","[","8","]",":","True","In","[","9","]",":","%","reset","-f","In","[","1","]",":","'","a","'","in","_ip.user_ns","Out","[","1","]",":","False","In","[","2","]",":","%","reset","-f","in","Flushing","input","history","In","[","3","]",":","%","reset","-f","dhist","in","Flushing","directory","history","Flushing","input","history","Notes","--","--","-","Calling","this","magic","from","clients","that","do","not","implement","standard","input",",","such","as","the","ipython","notebook","interface",",","will","reset","the","namespace","without","confirmation","."]
code: def reset(self, parameter_s=""):
      """Resets the namespace by removing all names defined by the user, if
      called without arguments, or by removing some types of objects, such
      as everything currently in IPython's In[] and Out[] containers (see
      the parameters for details).
  
      Parameters
      ----------
      -f : force reset without asking for confirmation.
  
      -s : 'Soft' reset: Only clears your namespace, leaving history intact.
          References to objects may be kept. By default (without this option),
          we do a 'hard' reset, giving you a new session and removing all
          references to objects from the current session.
  
      in : reset input history
  
      out : reset output history
  
      dhist : reset directory history
  
      array : reset only variables that are NumPy arrays
  
      See Also
      --------
      reset_selective : invoked as ``%reset_selective``
  
      Examples
      --------
      ::
  
        In [6]: a = 1
  
        In [7]: a
        Out[7]: 1
  
        In [8]: 'a' in _ip.user_ns
        Out[8]: True
  
        In [9]: %reset -f
  
        In [1]: 'a' in _ip.user_ns
        Out[1]: False
  
        In [2]: %reset -f in
        Flushing input history
  
        In [3]: %reset -f dhist in
        Flushing directory history
        Flushing input history
  
      Notes
      -----
      Calling this magic from clients that do not implement standard input,
      such as the ipython notebook interface, will reset the namespace
      without confirmation.
      """
      opts, args = self.parse_options(parameter_s, "sf", mode="list")
      if "f" in opts:
          ans = True
      else:
          try:
              ans = self.shell.ask_yes_no(
                  "Once deleted, variables cannot be recovered. Proceed (y/[n])?",
                  default="n",
              )
          except StdinNotImplementedError:
              ans = True
      if not ans:
          print("Nothing done.")
          return
  
      if "s" in opts:  # Soft reset
          user_ns = self.shell.user_ns
          for i in self.who_ls():
              del user_ns[i]
      elif len(args) == 0:  # Hard reset
          self.shell.reset(new_session=False)
  
      # reset in/out/dhist/array: previously extensinions/clearcmd.py
      ip = self.shell
      user_ns = self.shell.user_ns  # local lookup, heavily used
  
      for target in args:
          target = target.lower()  # make matches case insensitive
          if target == "out":
              print(
                  "Flushing output cache (%d entries)"
                  % len(user_ns["_oh"])
              )
              self.shell.displayhook.flush()
  
          elif target == "in":
              print("Flushing input history")
              pc = self.shell.displayhook.prompt_count + 1
              for n in range(1, pc):
                  key = "_i" + repr(n)
                  user_ns.pop(key, None)
              user_ns.update(dict(_i="", _ii="", _iii=""))
              hm = ip.history_manager
              # don't delete these, as %save and %macro depending on the
              # length of these lists to be preserved
              hm.input_hist_parsed[:] = [""] * pc
              hm.input_hist_raw[:] = [""] * pc
              # hm has internal machinery for _i,_ii,_iii, clear it out
              hm._i = hm._ii = hm._iii = hm._i00 = ""
  
          elif target == "array":
              # Support cleaning up numpy arrays
              try:
                  from numpy import ndarray
  
                  # This must be done with items and not iteritems because
                  # we're going to modify the dict in-place.
                  for x, val in list(user_ns.items()):
                      if isinstance(val, ndarray):
                          del user_ns[x]
              except ImportError:
                  print("reset array only works if Numpy is available.")
  
          elif target == "dhist":
              print("Flushing directory history")
              del user_ns["_dh"][:]
  
          else:
              print("Don't know how to reset ", end=" ")
              print(target + ", please run `%reset?` for details")
  
      gc.collect()
  
imports: from __future__ import print_function
  import gc
  import re
  import sys
  from IPython.core import page
  from IPython.core.error import StdinNotImplementedError, UsageError
  from IPython.core.magic import Magics, magics_class, line_magic
  from IPython.testing.skipdoctest import skip_doctest
  from IPython.utils.encoding import DEFAULT_ENCODING
  from IPython.utils.openpy import read_py_file
  from IPython.utils.path import get_py_filename
  from IPython.utils.py3compat import unicode_type
label_desc: Use image node_id 11 for calling the NamespaceMagics obj's underlying member method code with example usage: obj.reset(parameter_s) without return types