def prepare_url(url, source_url=None):
    """
    Operations that purify a url, removes arguments,
    redirects, and merges relatives with absolutes.
    """
    try:
        if source_url is not None:
            source_domain = urlparse(source_url).netloc
            proper_url = urljoin(source_url, url)
            proper_url = redirect_back(proper_url, source_domain)
            # proper_url = remove_args(proper_url)
        else:
            # proper_url = remove_args(url)
            proper_url = url
    except ValueError as e:
        log.critical((url, str(e)) % 'url %s failed on err %s')
        proper_url = ''

    return proper_url
dataset/ETHPy150Open codelucas/newspaper/newspaper/urls.py/prepare_url/swapped operands of `%`