def METHOD_NAME(self):
    if self.stream:
        self.stream.METHOD_NAME()
        self.stream = None
    if self._real_stream:
        self._real_stream.METHOD_NAME()
        self._real_stream = None