Whenever in the discretion of the building inspector it becomes necessary to prevent accidents or in the event of public necessity, it is lawful and it is made the duty of the building inspector to extend ropes across the defective sidewalk in such a manner as to prevent traffic from passing over such defective sidewalk. It is unlawful for any person to remove or interfere with such ropes without the consent of the building inspector. (Prior code § 4-4-19)