Skip to content

Instantly share code, notes, and snippets.

@chinskiy
Created June 3, 2019 20:27
Show Gist options
  • Select an option

  • Save chinskiy/ce774f761b508832e649353b289254a1 to your computer and use it in GitHub Desktop.

Select an option

Save chinskiy/ce774f761b508832e649353b289254a1 to your computer and use it in GitHub Desktop.
def get_flag_value(flag_name, uid, pct=50):
random = Random()
random.seed("%s-%s" % (uid, flag_name), version=1)
return int(random.random() * 100) + 1 <= pct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment