Add namespace function to Python startup file