Python code to implement and run an binary Hopfield network