def update_or_create(self, **kwargs):
        obj, created = self.get_or_create(**kwargs)
        if not created and 'defaults' in kwargs:
            for k,v in kwargs['defaults'].iteritems():
                setattr(obj, k, v)
            obj.save()
        return obj, created
dataset/ETHPy150Open dgouldin/django-socialite/socialite/apps/twitter/models.py/TwitterServiceManager.update_or_create/original