'Return the named extension.
Accessing an ExtensionManager as a dictionary (``em[\'name\']``)
produces the :class:`Extension` instance with the
specified name.'

def __getitem__(self, name):

    if (self._extensions_by_name is None):
        d = {}
        for e in self.extensions:
            d[e.name] = e
        self._extensions_by_name = d
    return self._extensions_by_name[name]
