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, container):
		self.x = container.x+randint(1, floor(container.w/3))
		self.y = container.y+randint(1, floor(container.h/3))
		self.w = container.w-(self.x-container.x)
		self.h = container.h-(self.y-container.y)
		self.w -= randint(0,floor(self.w/3))
		self.h -= randint(0,floor(self.w/3))
		self.environment = int(min(4,10*(container.distance_from_center/MAP_WIDTH)+random()*2-1))
		roll = random()*0.9+(2*container.distance_from_center/MAP_WIDTH)*0.1
		self.biome = next(n for n,b in enumerate(self.biomes_CDF) if roll<b)