def _check_stream(self):
        """Returns whether the stream is open, and if applicable, writable
        Returns
        -------
        bool
            Whether the stream is open
        """
        if self._stream.closed:
            return False

        try:
            # Attribute access kept separate from invocation, to avoid
            # swallowing AttributeErrors from the call which should bubble up.
            check_stream_writable = self._stream.writable
        except AttributeError:
            pass
        else:
            return check_stream_writable()

        return True
Returns whether the stream is open, and if applicable, writable
        Returns
        -------
        bool
            Whether the stream is open
        
halo/halo.py