Created
June 4, 2019 09:25
-
-
Save chinskiy/b6298c36de79d2c176e257c39e2140bf 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