def _update_status(self):
        app.logger.info("Updating status for {}".format(self))
        print "https://www.googleapis.com/youtube/v3/videos?id={}&part=snippet,liveStreamingDetails&key={}".format(self.ytid, app.config['YOUTUBE_KEY'])

        r = requests_get_with_retries(
            "https://www.googleapis.com/youtube/v3/videos?id={}&part=snippet,liveStreamingDetails&key={}".format(
                self.ytid, app.config['YOUTUBE_KEY']), retries_num=15)

        r.raise_for_status()
        if not r.json()['items']:
            self.status = 'completed'
            self.current_viewers = None
            return

        for item in r.json()['items']:

            self.youtube_channel = get_or_create(YoutubeChannel,
                                                 channel_id=item['snippet']['channelId'])
            self.youtube_channel.title = item['snippet']['channelTitle']

            # if there is streamer with this channel
            if self.youtube_channel.streamer is not None:
                self.streamer = self.youtube_channel.streamer
            elif self.streamer is not None:
                # if streamer has no yc and didn't ever checked profile
                if not self.streamer.checked:
                    self.streamer.youtube_channel_class = self.youtube_channel
                # otherwise
                else:
                    self.streamer = None

            self.title = item['snippet']['title']
            if 'liveStreamingDetails' in item:
                self.scheduled_start_time = item['liveStreamingDetails'].get('scheduledStartTime', None)
                if 'concurrentViewers' in item['liveStreamingDetails']:
                    self.current_viewers = item['liveStreamingDetails']['concurrentViewers']

            if item['snippet']['liveBroadcastContent'] == "none" and not self.actual_start_time:
                # TODO: it is probably better to have a separate column for vids
                self.actual_start_time = item['snippet'].get('publishedAt')

            if item['snippet']['liveBroadcastContent'] == 'live':
                self._go_live()
                if item['liveStreamingDetails'] in 'actualStartTime':
                    self.actual_start_time = item['liveStreamingDetails'].get('actualStartTime', None)
                else:  # Youtube is weird, and sometimes this happens. If there is no actual start time, then we fall back to scheduledStartTime
                    self.actual_start_time = item['liveStreamingDetails'].get('scheduledStartTime', None)
            elif item['snippet']['liveBroadcastContent'] == 'upcoming':
                self.status = 'upcoming'
            else:
                self.status = 'completed'
                self.current_viewers = None
dataset/ETHPy150Open WatchPeopleCode/WatchPeopleCode/wpc/models.py/YoutubeStream._update_status/swapped operands of `in`