in cassette/cassette_library.py [0:0]
def __getitem__(self, cassette_name):
"""Return the request if it is in memory. Otherwise, look to disk."""
if cassette_name in self.data:
req = self.data[cassette_name]
else:
# If not in self.data, need to fetch from disk
req = self._load_request_from_file(cassette_name)
if not req:
raise KeyError('Cassette %s does not exist in library.' %
cassette_name)
req.rewind()
return req