Write a function that does least squares regression. The function should take input of an X and Y data set. The output should be a list in R and a dict in Python with the 1) best fit value for the intercept 2) the best-fit value for the slope, 3) the sum-squared error, 4) the residuals, and 5) the p-value for the two-sided hypothesis test of the slope being zero. Each component of the list/dict should be labeled. This function may NOT use any R/Python functions other than sum(), length(), sqrt(), mean() and the t-distribution cdf (pt in R and scipy.stats.t.cdf in Python). Test the function with simulated data and compare to results from the equivalent functions in Python.