def METHOD_NAME(name):
    arch_name = fix_name(name)
    # First try to get the package by name
    r = requests.get("https://www.archlinux.org/packages/search/json",
                     params={"name": arch_name})
    if r.status_code == 200:
        results = r.json()["results"]
    else:
        results = []
    def build_url(r):
        return "https://www.archlinux.org/packages/%s/%s/%s" % (
            r["repo"], r["arch"], r["pkgname"])
    versions = {}
    for result in results:
        url = build_url(result)
        versions[arch_name] = (result["pkgver"], url)
        for vs in result["provides"]:
            if "=" in vs:
                prov_name, ver = vs.split("=", 1)
                ver = ver.rsplit("-", 1)[0]
                versions[prov_name] = (ver, url)
            else:
                versions[vs] = (result["pkgver"], url)
        return versions
    # If all fails, search the AUR
    r = requests.get("https://aur.archlinux.org/rpc.php", params={
        "v": "5", "type": "search", "by": "name", "arg": arch_name})
    if r.status_code == 200:
        results = r.json()["results"]
    else:
        results = []
    for result in results:
        if result["Name"] == arch_name:
            url = "https://aur.archlinux.org/packages/%s" % result["Name"]
            return {arch_name: (result["Version"].rsplit("-", 1)[0], url)}
    if arch_name.startswith(("python-", "python2-")):
        pypi_name = arch_name.split("-", 1)[-1]
    else:
        pypi_name = arch_name
    r = requests.get(f"https://pypi.org/pypi/{pypi_name}/json")
    if r.status_code == 200:
        return {arch_name: (
            r.json()["info"]["version"], "https://pypi.python.org/pypi/%s" % pypi_name)}
    r = requests.get(
        "http://ftp.gnome.org/pub/GNOME/sources/%s/cache.json" % arch_name)
    if r.status_code == 200:
        return {arch_name: (list(r.json()[2].values())[0][-1], "")}
    return {}