

def merge_user(strategy, uid, user=None, *args, **kwargs):
    provider = strategy.backend.name
    social = strategy.storage.user.get_social_auth(provider, uid)
    if social:
        if (user and (social.user != user)):
            Project.objects.filter(owner=social.user).update(owner=user)
            try:
                github = UserGithub.objects.get(user=provider.user)
                if github:
                    if (UserGithub.objects.filter(user=user).count() == 0):
                        github.user = user
                        github.save()
            except UserGithub.DoesNotExist:
                pass
            social.user.delete()
            social = None
        elif (not user):
            user = social.user
            mailinglist.add_user(user)
    return {
        'social': social,
        'user': user,
        'is_new': (user is None),
        'new_association': False,
    }

dataset/ETHPy150Open pebble/cloudpebble/auth/pebble.py merge_user/VarMisuse@99/113 `social`->`provider`