def __getitem__(self, name):
<EOL>if (name not in self._entrypoints or<EOL>self._epcache.get(name) is _unavailable):<EOL><INDENT>raise KeyError(name)<EOL><DEDENT>if name not in self._epcache:<EOL><INDENT>error = None<EOL>for ep in self._entrypoints[name]:<EOL><INDENT>try:<EOL><INDENT>self._epcache[name] = ep.load()<EOL><DEDENT>except (ImportError, AttributeError,<EOL>pkg_resources.UnknownExtra):<EOL><INDENT>if error is None:<EOL><INDENT>error = sys.exc_info()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self._epcache[name] = _unavailable<EOL>if error is None:<EOL><INDENT>raise KeyError(name)<EOL><DEDENT>six.reraise(*error)<EOL><DEDENT><DEDENT>return self._epcache[name]<EOL>
Retrieve the designated entrypoint object.

:param name: The name of the entrypoint.

:returns: The loaded object referenced by the entrypoint.