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 the registry stores the subclasses themselves; not class instances.
  In most cases you would then call ``from_params(params)`` on the returned subclass.
  
  You can specify a default by setting ``BaseClass.default_implementation``.
  If it is set, it will be the first element of ``list_available()``.
  
  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: List default first if it exists
docstr_tok: ["List","default","first","if","it","exists"]
code: def list_available(cls):
      """List default first if it exists"""
      keys = list(Registrable._registry[cls].keys())
      default = cls.default_implementation
  
      if default is None:
          return keys
      elif default not in keys:
          message = (
              "Default implementation %s is not registered" % default
          )
          raise ConfigurationError(message)
      else:
          return [default] + [k for k in keys if k != default]
  
file_path: magnitude/pymagnitude/third_party/allennlp/common/registrable.py
imports: from __future__ import absolute_import
  from collections import defaultdict
  import logging
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.from_params import FromParams
label_desc: Use image node_id 3 for calling the Registrable obj's underlying member method code with example usage: obj.list_available(cls) and returns: keys, unknown