def __init__(self, **kwargs):
        if "payload" in kwargs:
            payload_dict = kwargs["payload"]
            kwargs["tweet_id"] = payload_dict["id_str"]
            kwargs["screen_name"] = payload_dict["user"]["screen_name"]
            kwargs["payload"] = payload_dict
            kwargs["tweet_timestamp"] = datetime.datetime.strptime(payload_dict["created_at"], r"%a %b %d %H:%M:%S +0000 %Y")
            if not "country" in kwargs:
                try:
                    kwargs["country"] = payload_dict["place"]["country_code"]            
                except (AttributeError, TypeError):
                    pass
        super(Tweet, self).__init__(**kwargs)
dataset/ETHPy150Open Impactstory/total-impact-webapp/totalimpactwebapp/tweet.py/Tweet.__init__/original