On all motions the court may give or refuse costs at its discretion, unless where it is otherwise provided by law.