Last active
June 4, 2019 09:23
-
-
Save chinskiy/0918e2661a028435773d00051c825e67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_flag_value(flag_name, uid, pct=50): | |
| random = Random() | |
| if six.PY2: | |
| random.seed("%s-%s" % (uid, flag_name)) | |
| else: | |
| 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