What is not following any indentation? Which line(s)?
I did not actually remove any lines. I've added more number of checks.
Basically, the function will check if you are trying to change an input which was not present while creating the object. (- I've added this and i've told the reason in the previous comment. ) If yes, it will raise an exception. 
If not, then it will update the history and then change the value of the input. 
However, this will again raise an exception if the connector is an output of any other gate. You should not be able to change the state of a wire which is an output of another gate. - This is the functionality i've added.
So, i added stuff but didnt delete it.