def _process_items(self, person, items):
        self._getLogger().info('processing %s items' % len(items))
        for item in items:
            status = item.get('status', None)
            icaluid = item.get('iCalUID', None)
            start_date = dateutil.parser.parse(item['start']['dateTime']) if item in 'start' and 'dateTime' in item['start'] else None
            end_date = dateutil.parser.parse(item['end']['dateTime']) if 'end' in item and 'dateTime' in item['end'] else None
            if not all([start_date, end_date, status, icaluid]):
                self._getLogger().error('invalid start / end date / status / iCalUID')
            elif status == 'cancelled':
                res = Event.objects.filter(icaluid=icaluid)
                if res.count() == 1:
                    self._getLogger().info('deleted event')
                    res = res[0]
                    res.cancelled=True
                    res.save()
                else:
                    self._getLogger().info('failed to delete event')
            else:
                # assuming timezone is always israel because I can't seem to save timezone to sqlite
                start_date = start_date.replace(tzinfo=None)
                end_date = end_date.replace(tzinfo=None)
                update_date = dateutil.parser.parse(item['updated']).replace(tzinfo=None) if 'updated' in item else None
                link = item['htmlLink'] if 'htmlLink' in item else None
                summary = item['summary'] if 'summary' in item else None
                description = item['description'] if 'description' in item else None
                # it seems that google never returns the color, although the colorId field is documented
                colorId = item['colorId'] if 'colorId' in item else None
                data = unicode(item)
                kwargs = {
                    'when':start_date, 'when_over':end_date, 'link':link, 'what':summary, 'why':description,
                    'update_date': update_date,
                }
                res = Event.objects.filter(icaluid=icaluid)
                event, created = Event.objects.get_or_create(icaluid=icaluid, defaults=kwargs)
                event.who.add(person)
                if created:
                    self._getLogger().info('created new event')
                else:
                    self._getLogger().info('updated event')
dataset/ETHPy150Open ofri/Open-Knesset/events/scrapers.py/PersonsEventsScraper._process_items/swapped operands of `in`