If any such assembly cannot be otherwise dispersed, and if it is necessary for the public security that it should be dispersed, the Magistrate of the highest rank who is present may cause it to be dispersed by military force. ...