Model Agnostic Sample Reweighting for Out-of-Distribution Learning