```urlparse.urljoin``` will I think accomplish what these two lines are doing.