class_docstr: A configurable that only allows one instance.
  
  This class is for classes that should only have one instance of itself
  or *any* subclass. To create and retrieve such a class use the
  :meth:`SingletonConfigurable.instance` method.
class_docstr_tok: ["A","configurable","that","only","allows","one","instance",".","This","class","is","for","classes","that","should","only","have","one","instance","of","itself","or","*","any","*","subclass",".","To","create","and","retrieve","such","a","class","use","the",":","meth",":","`","SingletonConfigurable.instance","`","method","."]
docstr: unset _instance for this class and singleton parents.
          
docstr_tok: ["unset","_instance","for","this","class","and","singleton","parents","."]
code: def clear_instance(cls):
      """unset _instance for this class and singleton parents."""
      if not cls.initialized():
          return
      for subclass in cls._walk_mro():
          if isinstance(subclass._instance, cls):
              # only clear instances that are instances
              # of the calling class
              subclass._instance = None
  
imports: from __future__ import print_function, absolute_import
  from copy import deepcopy
  import warnings
  from .loader import Config, LazyConfigValue, _is_section_key
  from traitlets.traitlets import HasTraits, Instance, observe, observe_compat, default
  from ipython_genutils.text import indent, dedent, wrap_paragraphs
label_desc: Use image node_id 2 for calling the SingletonConfigurable obj's underlying member method code with example usage: obj.clear_instance(cls) without return types