def __getitem__(self, cls):
if not self.is_enabled(cls):<EOL><INDENT>return None<EOL><DEDENT>component = self.components.get(cls)<EOL>if not component and not issubclass(cls, ComponentManager):<EOL><INDENT>if cls not in ComponentMeta._components:<EOL><INDENT>raise DocidoError(<EOL>'<STR_LIT>' % cls.__name__<EOL>)<EOL><DEDENT>try:<EOL><INDENT>component = cls(self)<EOL><DEDENT>except TypeError as e:<EOL><INDENT>raise DocidoError(<EOL>'<STR_LIT>' % (cls, e)<EOL>)<EOL><DEDENT><DEDENT>return component<EOL>
Activate the component instance for the given class, or
        return the existing instance if the component has already been
        activated.

        Note that `ComponentManager` components can't be activated
        that way.