Those are interesting observations, but overall Hamas still counts as a government because Israel stopped maintaining an on the ground police force in Gaza in 2005; since then, the on the ground continuous police presence has only been Hamas. If you're a country and you face intermittent incursions from a foreign military, you're still a country with a government. The Palestinian Authority has its own legal code! https://www.venice.coe.int/webforms/documents/default.aspx?pdffile=CDL(2009)008-e - That's a government man.