def METHOD_NAME(domain, info):
    """Determine the URL corresponding to Python object.
    This is taken from SciPy's conf.py:
    https://github.com/scipy/scipy/blob/master/doc/source/conf.py.
    """
    if domain != "py":
        return None
    modname = info["module"]
    fullname = info["fullname"]
    submod = sys.modules.get(modname)
    if submod is None:
        return None
    obj = submod
    for part in fullname.split("."):
        try:
            obj = getattr(obj, part)
        except Exception:
            return None
    try:
        fn = inspect.getsourcefile(obj)
    except Exception:
        fn = None
    if not fn:
        try:
            fn = inspect.getsourcefile(sys.modules[obj.__module__])
        except Exception:
            fn = None
    if not fn:
        return None
    try:
        source, lineno = inspect.getsourcelines(obj)
    except Exception:
        lineno = None
    if lineno:
        linespec = "#L%d-L%d" % (lineno, lineno + len(source) - 1)
    else:
        linespec = ""
    startdir = os.path.abspath(os.path.join(dirname(pyxem.__file__), ".."))
    fn = relpath(fn, start=startdir).replace(os.path.sep, "/")
    if fn.startswith("pyxem/"):
        m = re.match(r"^.*dev0\+([a-f0-9]+)$", pyxem.__version__)
        pre_link = "https://github.com/pyxem/pyxem/blob/"
        if m:
            return pre_link + "%s/%s%s" % (m.group(1), fn, linespec)
        elif "dev" in pyxem.__version__:
            return pre_link + "master/%s%s" % (fn, linespec)
        else:
            return pre_link + "v%s/%s%s" % (pyxem.__version__, fn, linespec)
    else:
        return None