def __getitem__(self, name):
if name in self.converters:<EOL><INDENT>return self.converters[name]<EOL><DEDENT>for ep in iter_entry_points(self.entry_point):<EOL><INDENT>if ep.name == name:<EOL><INDENT>self.converters[ep.name] = ep.load()()<EOL>return self.converters[ep.name]<EOL><DEDENT><DEDENT>for ep in (EntryPoint.parse(c) for c in self.registered_converters + self.internal_converters):<EOL><INDENT>if ep.name == name:<EOL><INDENT>if hasattr(ep, '<STR_LIT>'):<EOL><INDENT>plugin = ep.resolve()<EOL><DEDENT>elif hasattr(ep, '<STR_LIT>'):<EOL><INDENT>plugin = ep._load()<EOL><DEDENT>else:<EOL><INDENT>plugin = ep.load(require=False)<EOL><DEDENT>self.converters[ep.name] = plugin()<EOL>return self.converters[ep.name]<EOL><DEDENT><DEDENT>raise KeyError(name)<EOL>
Get a converter, lazy loading it if necessary