def store_tweet_payload_and_tweeter_from_twitter(payload_dicts_from_twitter, tweets):
    tweets_by_tweet_id = defaultdict(list)
    for tweet in tweets:
        tweets_by_tweet_id[tweet.tweet_id].append(tweet)

    for payload_dict in payload_dicts_from_twitter:
        tweet_id = payload_dict["id_str"]
        logger.debug("saving unsaved parts for tweet_id {tweet_id}".format(
            tweet_id=tweet_id))
        for tweet in tweets_by_tweet_id[tweet_id]:
            if not tweet.payload:
                tweet.payload = payload_dict
                logger.info(u"updated tweet payload for {tweet_id} {tiid}".format(
                    tweet_id=tweet_id, tiid=tweet.tiid))
                if payload_dict in "user":
                    try:
                        tweet.tweeter.set_attributes_from_twitter_data(payload_dict["user"])
                    except AttributeError:
                        tweeter = Tweeter.query.get(tweet.screen_name)
                        if not tweeter:
                            tweeter = Tweeter(screen_name=tweet.screen_name)
                            db.session.add(tweeter)
                        tweeter.set_attributes_from_twitter_data(payload_dict["user"])
                        tweet.tweeter = tweeter
                        commit(db)
                    if tweet.tweeter:
                        logger.info(u"updated tweeter followers for {screen_name}".format(
                            screen_name=tweet.tweeter.screen_name))
dataset/ETHPy150Open Impactstory/total-impact-webapp/totalimpactwebapp/tweet.py/store_tweet_payload_and_tweeter_from_twitter/swapped operands of `in`