def get_userdata(self, code):
        """Returns the relevant userdata from github.

        This function must be called from githun oauth callback
        and the auth code must be passed as argument.
        """
        try:
            session = self.get_auth_session(data={'code': code})
            d = session.get('user').json()
            email = self.get_verified_email(session)
            if not email:
                logger.error("No verified email found for this user {}".format(d['login']))
                return
            return dict(
                name=d["name"],
                email=email,
                username=d["login"],
                github=d["login"],
                service="GitHub")
        except __HOLE__, e:
            logger.error("failed to get user data from github. Error: %s",
                         str(e))
dataset/ETHPy150Open anandology/broadgauge/broadgauge/oauth.py/GitHub.get_userdata