def get_fslocation_from_item(item):
result = getattr(item, "<STR_LIT:location>", None)<EOL>if result is not None:<EOL><INDENT>return result[:<NUM_LIT:2>]<EOL><DEDENT>obj = getattr(item, "<STR_LIT>", None)<EOL>if obj is not None:<EOL><INDENT>return getfslineno(obj)<EOL><DEDENT>return getattr(item, "<STR_LIT>", "<STR_LIT>"), -<NUM_LIT:1><EOL>
Tries to extract the actual location from an item, depending on available attributes:

    * "fslocation": a pair (path, lineno)
    * "obj": a Python object that the item wraps.
    * "fspath": just a path

    :rtype: a tuple of (str|LocalPath, int) with filename and line number.