def get_dir_from_zipfile(zip_file, fallback=None):
    """Return the name of the root folder in a zip file.

    :param zip_file: a :class:`zipfile.ZipFile` instance.
    :param fallback: if `None`, the name of the zip file is used. This is
        returned if the zip file contains more than one top-level directory,
        or none at all.
    """
    fallback = fallback or zip_file.filename
    directories = [name for name in zip_file.namelist() if name.endswith("/")
                   and len(PurePath(name).parts) == 1]
    return fallback if len(directories) > 1 else directories[0]
def __init__(self, root, split="train", pass_name="clean", transforms=None):
        super().__init__(root=root, transforms=transforms)

        verify_str_arg(split, "split", valid_values=("train", "test"))
        verify_str_arg(pass_name, "pass_name", valid_values=("clean", "final", "both"))
        passes = ["clean", "final"] if pass_name == "both" else [pass_name]

        root = Path(root) / "Sintel"
        flow_root = root / "training" / "flow"

        for pass_name in passes:
            split_dir = "training" if split == "train" else split
            image_root = root / split_dir / pass_name
            for scene in os.listdir(image_root):
                image_list = sorted(glob(str(image_root / scene / "*.png")))
                for i in range(len(image_list) - 1):
                    self._image_list += [[image_list[i], image_list[i + 1]]]

                if split == "train":
                    self._flow_list += sorted(glob(str(flow_root / scene / "*.flo")))