is hunting or herding, or where training is being conducted or where trials are being held, provided that such dog does not have to be within sight at all time; (b) If it barks for sustained periods of more than 1/2 hour, or during the night hours so as to disturb the peace and quiet of a neighborhood or area, not including a dog which is guarding, working, or herding livestock, as defined in RSA