human
Complete this python program:
def GetS3CompatibleFileList(root, prefix=None):
assistant
#Here is the Python code you requested.

    """Returns a list of filenames from the local object store
    which emulates the sorting order of keys returned from an
    AWS S3 file store.
    """
    def _ListFiles(dir):
        for obj in os.listdir(dir):
            objpath = os.path.join(dir, obj)
            if os.path.isfile(objpath):
                (yield os.path.relpath(objpath, root))
            elif os.path.isdir(objpath):
                for f in _ListFiles(objpath):
                    (yield f)
    filelist = [x for x in _ListFiles(root) if ((not prefix) or x.startswith(prefix))]
    return sorted(filelist)