def get_source_link(thing, source_location):
try:<EOL><INDENT>lineno = get_line(thing)<EOL>try:<EOL><INDENT>owner_module = inspect.getmodule(thing)<EOL>assert owner_module is not None<EOL><DEDENT>except (TypeError, AssertionError):<EOL><INDENT>owner_module = inspect.getmodule(thing.fget)<EOL><DEDENT>thing_file = "<STR_LIT:/>".join(owner_module.__name__.split("<STR_LIT:.>"))<EOL>if owner_module.__file__.endswith("<STR_LIT>"):<EOL><INDENT>thing_file += "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>thing_file += "<STR_LIT>"<EOL><DEDENT>return (<EOL>f"<STR_LIT>"<EOL>+ "<STR_LIT>"<EOL>)<EOL><DEDENT>except Exception as e:<EOL><INDENT>pass<EOL><DEDENT>return "<STR_LIT>"<EOL>
Get a link to the line number a module/class/function is defined at.

Parameters
----------
thing : function or class
    Thing to get the link for
source_location : str
    GitHub url of the source code

Returns
-------
str
    String with link to the file & line number, or empty string if it
    couldn't be found