(self, key)
Return the keyed message; raise KeyError if it doesn't exist.
Return the keyed message; raise KeyError if it doesn't exist.
Return the keyed message ; raise KeyError if it doesn t exist .
def __getitem__(self, key):
        """Return the keyed message; raise KeyError if it doesn't exist."""
        if not self._factory:
            return self.get_message(key)
        else:
            with contextlib.closing(self.get_file(key)) as file:
                return self._factory(file)
def __getitem__ ( self , key ) : if not self . _factory : return self . get_message ( key ) else : with contextlib . closing ( self . get_file ( key ) ) as file : return self . _factory ( file )