Skip to content

Instantly share code, notes, and snippets.

View chusteven's full-sized avatar

Steven Chu chusteven

  • San Francisco, CA
View GitHub Profile
[package]
name = "zero2prod"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
path = "src/lib.rs"
from typing import Any
from typing import List
from typing import Tuple
from random import random
def final_weighted_sample_without_replacement(
population: List[Tuple[Any, float]], weights: tuple, k: int = 1
) -> List[Tuple[Any, float]]:
from typing import Any
from typing import List
from typing import Tuple
from random import choices
def weighted_sample_without_replacement(
population: List[Tuple[Any, float]], weights: tuple, k: int = 1
) -> List[Tuple[Any, float]]:
from typing import Any
from typing import List
from typing import Tuple
from random import choices
def weighted_sample_without_replacement(
population: List[Tuple[Any, float]], weights: tuple, k: int = 1
) -> List[Tuple[Any, float]]:
from typing import Any
from typing import List
from typing import Tuple
from random import choices
def weighted_sample_without_replacement(
population: List[Tuple[Any, float]], weights: tuple, k: int = 1
) -> List[Tuple[Any, float]]: