code: def inspect_last(self, stream, only_allocated=False):
          if only_allocated:
              found = False
              for walker in self._virtual_walkers:
                  if walker.matches(stream):
                      found = True
                      break
              if not found:
                  raise UnresolvedIdentifierError("inspect_last could not find an allocated virtual streamer for the desired stream", stream=stream)
          if stream in self._last_values:
              return self._last_values[stream]
          raise StreamEmptyError(u"inspect_last called on stream that has never been written to", stream=stream)