def validate_macaroon(self, macaroon, type_string, verify_expiry):
        v = pymacaroons.Verifier()
        v.satisfy_exact("gen = 1")
        v.satisfy_exact("type = " + type_string)
        v.satisfy_general(lambda c: c.startswith("user_id = "))
        v.satisfy_exact("guest = true")
        if verify_expiry:
            v.satisfy_general(self._verify_expiry)
        else:
            v.satisfy_general(lambda c: c.startswith("time < "))

        v.verify(macaroon, self.hs.config.macaroon_secret_key)

        v = pymacaroons.Verifier()
        v.satisfy_general(self._verify_recognizes_caveats)
        v.verify(macaroon, self.hs.config.macaroon_secret_key)
DESCRIPTION:
dataset/ETHPy150Open matrix-org/synapse/synapse/api/auth.py/Auth.validate_macaroon--crossover with--dataset/ETHPy150Open hycis/Pynet/pynet/utils/utils.py/generate_shared_list