def user_to_dict(self, user):
        if not user:
            return None

        user_dict = dict((a, getattr(user, a)) for a in self.user_attributes)
        user_dict['user_id'] = user.get_id()
        return user_dict

    # Session related ---------------------------------------------------------
Iterate over permissions and parse into dicts
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/webapp2-2.3/webapp2_extras/auth.py/AuthStore.user_to_dict--crossover with--dataset/ETHPy150Open MediaMath/t1-python/terminalone/xmlparser.py/XMLParser._parse_permissions