class_docstr: Any class that inherits from ``Registrable`` gains access to a named
  registry for its subclasses. To register them, just decorate them with the
  classmethod ``@BaseClass.register(name)``.
  
  After which you can call ``BaseClass.list_available()`` to get the keys
  for the registered subclasses, and ``BaseClass.by_name(name)`` to get the
  corresponding subclass.
  
  Note that if you use this class to implement a new ``Registrable``
  abstract class, you must ensure that all subclasses of the abstract class
  are loaded when the module is loaded, because the subclasses register
  themselves in their respective files. You can achieve this by having the
  abstract class and all subclasses in the __init__.py of the module in
  which they reside (as this causes any import of either the abstract class
  or a subclass to load all other subclasses and the abstract class).
docstr: Decorator used to add the decorated subclass to the registry of the
  base class
  
  Args:
      name (str): name use to identify the registered subclass
      override (bool, optional): this parameter controls the behavior in
          case where a subclass is registered with the same identifier.
          If True, then the previous subclass will be unregistered in
          profit of the new subclass.
  
  Raises:
      AlreadyRegisteredError: when ``override`` is False, while trying
          to register a subclass with a name already used by another
          registered subclass
docstr_tok: ["Decorator","used","to","add","the","decorated","subclass","to","the","registry","of","the","base","class","Args",":","name","(","str",")",":","name","use","to","identify","the","registered","subclass","override","(","bool",",","optional",")",":","this","parameter","controls","the","behavior","in","case","where","a","subclass","is","registered","with","the","same","identifier",".","If","True",",","then","the","previous","subclass","will","be","unregistered","in","profit","of","the","new","subclass",".","Raises",":","AlreadyRegisteredError",":","when","``","override","``","is","False",",","while","trying","to","register","a","subclass","with","a","name","already","used","by","another","registered","subclass"]
code: def register(cls, name, override=False):
      """Decorator used to add the decorated subclass to the registry of the
      base class
  
      Args:
          name (str): name use to identify the registered subclass
          override (bool, optional): this parameter controls the behavior in
              case where a subclass is registered with the same identifier.
              If True, then the previous subclass will be unregistered in
              profit of the new subclass.
  
      Raises:
          AlreadyRegisteredError: when ``override`` is False, while trying
              to register a subclass with a name already used by another
              registered subclass
      """
      registry = Registrable._registry[cls]
  
      def add_subclass_to_registry(subclass):
          # Add to registry, raise an error if key has already been used.
          if not override and name in registry:
              raise AlreadyRegisteredError(name, cls, registry[name])
          registry[name] = subclass
          return subclass
  
      return add_subclass_to_registry
  
file_path: snips-nlu/snips_nlu/common/registrable.py
imports: from collections import defaultdict
  from future.utils import iteritems
  from snips_nlu.exceptions import AlreadyRegisteredError, NotRegisteredError
label_desc: Use image node_id 1 for calling the Registrable obj's underlying member method code with example usage: obj.register(cls, name, override) and returns: add_subclass_to_registry, subclass