7 . All Courts of Justice shall take judicial cognizance of such by-laws and of any repeal, alteration, or amendment thereof when and so soon as the same shall have been so duly confirmed and published as aforesaid ; and all officers of police and headmen are hereby required to assist in carrying out the provisions thereof. *Courts to take cognizance of by-laws.*