Skip to content

Instantly share code, notes, and snippets.

@leafsummer
Created November 19, 2019 05:28
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 leafsummer/43023c37920b8bbaf09e44bea28e0797 to your computer and use it in GitHub Desktop.
Save leafsummer/43023c37920b8bbaf09e44bea28e0797 to your computer and use it in GitHub Desktop.
sample data
this_max = min(sample["this"], sample["this"] * sample["max"] / sample["total"] + 1)
sample_a = 1
if this_max > 1:
sample_b = math.log(sample["this"]) / math.log(this_max)
else:
sample_b = 1
sample_target = int(sample_a * ((line_num + 1) ** sample_b) + 0.5) # line_no >= sample_target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment