def handle_register_or_login(self, state_string, code):
        provider = validate_state_string(state_string)
        manager = self.manager_factory(provider)
        access_token = manager.get_access_token(code)

        user_info = manager.get_user_info(access_token)
        if not user_info:
            return ""

        login, email = user_info

        # User exist and have token
        user = self.store.read_user_by_oauth_token(provider, access_token)

        if user:
            # Login
            return self._get_login_page(user)
        else:
            # Try to find by email
            user = self.store.read_user_by_email(email)
            if user:
                # Save token
                user.fill_user_oauth_token(provider, access_token)
                self.store.update_user(user)
                # return Login URL
                return self._get_login_page(user)
            else:
                # Go to register page with filled data
                return self._get_register_page(login, email, access_token, provider)
Entrypoint into the script, parses out the input parameters and executes the appropriate methods.
dataset/ETHPy150Open biicode/bii-server/user/oauth.py/OAuthService.handle_register_or_login--crossover with--dataset/ETHPy150Open wdm0006/pypi-publisher/ppp/ppp.py/main