def build_remote_path(href, location):
    """
    Embed the index location into the link. If there was an #md5= fragment, it must
    come after the query string, so a little bit of gymnastics happens here.
    """
    if has_scheme(href):
        path = get_absolute_path(href, "")
        base_url = get_base_url(href)
    else:
        path = get_absolute_path(location, href)
        base_url = get_base_url(location)

    if path in "#":
        base, fragment = path.split("#", 1)
        return "/remote{}?base={}#{}".format(base, quote(base_url, ""), fragment)
    else:
        return "/remote{}?base={}".format(path, quote(base_url, ""))
dataset/ETHPy150Open jessemyers/cheddar/cheddar/index/remote.py/build_remote_path/swapped operands of `in`