Explanation of sharevalue.py 's code