Public offenses may be prevented by the intervention of officers of justice:

1.    By requiring security to keep the peace; 2.    By providing police in cities and by requiring their attendance in exposed places; and

3.    By suppressing riots.