@stream.setter
    def stream(self, value):
        if isinstance(value, string_types):
            if self._stream_cache in value:
                value = self._stream_cache[value]
            else:
                value = self._stream_cache[value] = open(value, 'a', buffering=0)

        isatty = getattr(value, 'isatty', None)
        if self.force_colors or (isatty and isatty() and os.name != 'java'):
            self._stream = AnsiToWin32(value, strip=False)
            self._tty = True
            self.event_colors = EVENT_COLORS
            self.code_colors = CODE_COLORS
        else:
            self._tty = False
            self._stream = value
            self.event_colors = NO_COLORS
            self.code_colors = NO_COLORS
dataset/ETHPy150Open ionelmc/python-hunter/src/hunter/actions.py/ColorStreamAction.stream/swapped operands of `in`