def emit(self, message):
        stream_name = self.stream_name
        if stream_name is None:
            stream_name = message.name
        if self.sequence_tokens not in stream_name:
            _idempotent_create(self.cwl_client.create_log_stream,
                               logGroupName=self.log_group, logStreamName=stream_name)
            self.sequence_tokens[stream_name] = None

        msg = dict(timestamp=int(message.created * 1000), message=self.format(message))
        if isinstance(msg["message"], collections.Mapping):
            msg["message"] = json.dumps(msg["message"])
        if self.use_queues:
            if stream_name not in self.queues:
                self.queues[stream_name] = Queue.Queue()
                thread = threading.Thread(target=self.batch_sender,
                                          args=(self.queues[stream_name], stream_name, self.send_interval,
                                                self.max_batch_size, self.max_batch_count))
                self.threads.append(thread)
                thread.daemon = True
                thread.start()
            if self.shutting_down:
                warnings.warn("Received message after logging system shutdown", PyCWLWarning)
            else:
                self.queues[stream_name].put(msg)
        else:
            self._submit_batch([msg], stream_name)
dataset/ETHPy150Open kislyuk/watchtower/watchtower/__init__.py/CloudWatchLogHandler.emit/swapped operands of `not in`