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