'Given a user_info object of variable type (depending on the platform),
extract the relevant information by calling the platform\'s extractors
(`x_user_name`, `x_user_id`, etc).
Returns a `UserInfo`. The `user_id` attribute is guaranteed to have a
unique non-empty value.'

def extract_user_info(self, info):

    r = UserInfo(platform=self.name)
    info = self.x_user_info(r, info, info)
    r.user_name = self.x_user_name(r, info, None)
    if (self.x_user_id.__func__ is not_available):
        r.user_id = r.user_name
    else:
        r.user_id = self.x_user_id(r, info)
    assert (r.user_id is not None)
    r.user_id = unicode(r.user_id)
    assert (len(r.user_id) > 0)
    r.display_name = self.x_display_name(r, info, None)
    r.email = self.x_email(r, info, None)
    r.avatar_url = self.x_avatar_url(r, info, None)
    if (not r.avatar_url):
        gravatar_id = self.x_gravatar_id(r, info, None)
        if (r.email and (not gravatar_id)):
            gravatar_id = hashlib.md5(r.email.strip().lower()).hexdigest()
        if gravatar_id:
            r.avatar_url = (u'https://secure.gravatar.com/avatar/' + gravatar_id)
    r.is_team = self.x_is_team(r, info, False)
    r.extra_info = info
    return r
