Skip to content

Instantly share code, notes, and snippets.

View florimondmanca's full-sized avatar
🌱

Florimond Manca florimondmanca

🌱
View GitHub Profile
@florimondmanca
florimondmanca / async_example.py
Last active June 16, 2023 10:19
HTTPX integration for OpenTelemetry (Proof of Concept)
from opentelemetry.instrumentation import httpx_client as httpx_opentelemetry
async def main():
opentelemetry_on_request, opentelemetry_on_response = httpx_opentelemetry.create_async_hooks()
event_hooks = {
"request": [opentelemetry_on_request],
"response": [opentelemetry_on_response]
}
@florimondmanca
florimondmanca / bayesodds.py
Last active December 24, 2020 15:20
Bayes' Rule, reframed "odds" instead of "chances"
"""
Bayes rule, reframed as "odds" instead of "chances".
https://twitter.com/florimondmanca/status/1342119381573238789
Inspired by 3Blue1Brown's "The medical test paradox: Can redesigning Bayes rule help?".
"""
from fractions import Fraction
from typing import Any