def has_target(fn):
    try:
        f = open(fn, 'r')
    except __HOLE__:
        print("Can't open %s. Not touching it." % fn)
        return (True, None)
    readok = True
    try:
        lines = f.readlines()
    except IOError:
        print("Can't read %s. Not touching it." % fn)
        readok = False
    finally:
        f.close()
        if not readok:
            return (True, None)

    #print fn, len(lines)
    if len(lines) < 1:
        print("Not touching empty file %s." % fn)
        return (True, None)
    if lines[0].startswith('.. _'):
        return (True, None)
    return (False, lines)
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/docs/_ext/applyxrefs.py/has_target