This is a simple script which implements the Generalized Least-Squares which takes errors in both dependent and independent variables. The script is generic enough to work with more than 2 independent variables and their associated errors/uncertainties.
The code has been validated against the other available methods.
For the detail description of the method:
Ghilani, C. and Wolf, P. (2006) Adjustment computations spatial data analysis. Fourth edition. John Wiley & Sons, New Jersey.