def filter(self, userinfo, user_info_claims=None):

        if user_info_claims is None:
            return copy.copy(userinfo)
        else:
            result = {}
            missing = []
            optional = []
            for key, restr in user_info_claims.items():
                try:
                    result[key] = userinfo[key]
                except KeyError:
                    if restr == {"essential": True}:
                        missing.append(key)
                    else:
                        optional.append(key)
            return result
Return only those claims that are asked for.
dataset/ETHPy150Open rohe/pyoidc/src/oic/utils/userinfo/__init__.py/UserInfo.filter