code: def init(cls, name):
          
          clsdict = {subcls.name: subcls for subcls in cls.__subclasses__()
                     if hasattr(subcls, 'name')}
          return clsdict.get(name, cls)(name)
docs: Return an instance of this class or an appropriate subclass