def METHOD_NAME(self, raw_macaroon):
    """
    Returns the id of the user associated with the given raw (serialized)
    macaroon.
    """
    try:
        m = self._deserialize_raw_macaroon(raw_macaroon)
    except InvalidMacaroonError:
        return None
    try:
        identifier = m.identifier.decode()
    except UnicodeDecodeError:
        return None
    dm = self.find_macaroon(identifier)
    if dm is None:
        return None
    # This can be None if the macaroon has no associated user
    # (e.g., an OIDC-minted macaroon).
    if dm.user is None:
        return None
    return dm.user.id