Upon the trial of a person who has been arrested on a warrant to keep the peace, and bound over for appearance at court to answer the charge, the court may, at its discretion, order the person, or the person at whose instance the warrant was taken out, to pay the costs.