leader election code -node_elect.py