<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def repair_url(url):
 """ Fixes URL. @param url: url to repair. @param out: instance of StandardOutput as defined in this lib. @return: Newline characters are stripped from the URL string. If the url string parameter does not start with http, it prepends http:// If the url string parameter does not end with a slash, appends a slash. If the url contains a query string, it gets removed. """

    url = url.strip('\n')
    if not re.match(r"^http", url):
        url = "http://" + url

    if "?" in url:
        url, _ = url.split('?')

    if not url.endswith("/"):
        return url + "/"
    else :
        return url