This file contains 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
# cite: https://www.youtube.com/watch?v=Ys8ofBeR2kA | |
# Run python or jupyter with | |
# $ PYTHONHASHSEED=0 jupyter notebook | |
# $ PYTHONHASHSEED=0 python code.py | |
# check | |
if os.environ.get("PYTHONHASHSEED") != "0": | |
raise Exception("You must set PYTHONHASHSEED=0 when starting the Jupyter server to get reproducible results.") | |