You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
315 B

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)