(b)regulating traffic of all kinds in streets and public places, and the use of streets and public places by persons riding, driving, cycling, walking or leading or accompanying cattle, so as to prevent danger, obstruction or inconvenience to the public;