Skip to content

Instantly share code, notes, and snippets.

@samueleresca
Created April 26, 2021 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueleresca/dedc3d2fb3766ea119e5125d5873e7e2 to your computer and use it in GitHub Desktop.
Save samueleresca/dedc3d2fb3766ea119e5125d5873e7e2 to your computer and use it in GitHub Desktop.
'''
Original code available at: https://github.com/mwhittaker/quoracle
'''
from typing import Dict, Optional, Union
Fraction = float
Weight = float
Probability = float
Distribution = Union[
# For example, 1 means 100% reads.
int,
# For example, 0.25 means 25% reads.
float,
# For example, {0.25: 1, 0.8: 2} means 25% reads one third of the time and
# 80% reads two thirds of the time.
Dict[Fraction, Weight],
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment