Returns os.stat for a given file, adjusting the timestamps as appropriate.

def stat(filename):
    """Returns os.stat for a given file, adjusting the timestamps as appropriate."""
    import os
    try:
        # on the host, lstat won't try to follow symlinks
        rstat = os.lstat(filename)
    except:
        rstat = os.stat(filename)
    return rstat[:7] + tuple(tim + TIME_OFFSET for tim in rstat[7:])