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, 'redirect_uri': self.redirect_uri})
            d = session.get('me').json()
            # suggest basename of the email as username
            username = d['email'].split("@")[0]
            return dict(
                name=d['name'],
                email=d['email'],
                username=username,
                service='Facebook')
        except __HOLE__, e:
            logger.error("failed to get user data from facebook. Error: %s",
                         str(e), exc_info=True)
dataset/ETHPy150Open anandology/broadgauge/broadgauge/oauth.py/Facebook.get_userdata