Edm0nd/edmond/utils.py

16 lines
315 B
Python

import random
from typing import Optional
import requests
def http_get(url: str) -> Optional[str]:
response = requests.get(url)
if response.status_code == 200:
return response.text
return None
def proc(proba_percentage: int) -> bool:
return random.random() < (proba_percentage / 100.0)