def find_projectfiles(rootdir):
    """Iterates recursively over rootdir and yields
    every filename that looks like a credible project.pbxproj.
    """
    validfirstchars = {'/',  # usual header for the plist format: // !$*UTF8*$!
                       '<',  # <?xml version="1.0" encoding="UTF-8"?>
                       '{'   # plist format without the UTF8 header
                       }
    for path, dirs, files in os.walk(rootdir):
        for name in files:
            if name != PBXPROJNAME:
                continue
            filename = os.path.join(path, name)
            with codecs.open(filename, 'r', encoding='utf-8') as f:
                c = f.read(1)
                if c in validfirstchars:
                    yield filename
dataset/ETHPy150Open mikr/xcodeprojer/xcodeprojer.py/find_projectfiles/original