def getfslineno(obj):
from .code import Code<EOL>try:<EOL><INDENT>code = Code(obj)<EOL><DEDENT>except TypeError:<EOL><INDENT>try:<EOL><INDENT>fn = inspect.getsourcefile(obj) or inspect.getfile(obj)<EOL><DEDENT>except TypeError:<EOL><INDENT>return "<STR_LIT>", -<NUM_LIT:1><EOL><DEDENT>fspath = fn and py.path.local(fn) or None<EOL>lineno = -<NUM_LIT:1><EOL>if fspath:<EOL><INDENT>try:<EOL><INDENT>_, lineno = findsource(obj)<EOL><DEDENT>except IOError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>fspath = code.path<EOL>lineno = code.firstlineno<EOL><DEDENT>assert isinstance(lineno, int)<EOL>return fspath, lineno<EOL>
Return source location (path, lineno) for the given object.
    If the source cannot be determined return ("", -1).

    The line number is 0-based.