Borrow a bit from scipy definition