tests/run_all_images_multiprocess.py
def _openSubCaches(
	mainCachePath: str,
	numSubCaches: int
) -> Tuple[List[FileContext], List[BinaryIO]]:
	"""Create FileContext objects for each sub cache.

	Assumes that each sub cache has the same base name as the
	main cache, and that the suffixes are preserved.

	Also opens the symbols cache, and adds it to the end of
	the list.

	Returns:
		A list of subcaches, and their file objects, which must be closed!
	"""
	subCaches = []
	subCachesFiles = []

	subCacheSuffixes = [i for i in range(1, numSubCaches + 1)]
	subCacheSuffixes.append("symbols")
	for cacheSuffix in subCacheSuffixes:
		subCachePath = f"{mainCachePath}.{cacheSuffix}"
		cacheFileObject = open(subCachePath, mode="rb")
		cacheFileCtx = FileContext(cacheFileObject)

		subCaches.append(cacheFileCtx)
		subCachesFiles.append(cacheFileObject)
		pass

	return subCaches, subCachesFiles
Create FileContext objects for each sub cache.

	Assumes that each sub cache has the same base name as the
	main cache, and that the suffixes are preserved.

	Also opens the symbols cache, and adds it to the end of
	the list.

	Returns:
		A list of subcaches, and their file objects, which must be closed!
	
Create FileContext objects for each sub cache.
Assumes that each sub cache has the same base name as the
main cache, and that the suffixes are preserved.

Also opens the symbols cache, and adds it to the end of
the list.
Create FileContext objects for each sub cache . Assumes that each sub cache has the same base name as the main cache and that the suffixes are preserved . Also opens the symbols cache and adds it to the end of the list .
def _openSubCaches(
	mainCachePath: str,
	numSubCaches: int
) -> Tuple[List[FileContext], List[BinaryIO]]:
	subCaches = []
	subCachesFiles = []
	subCacheSuffixes = [i for i in range(1, numSubCaches + 1)]
	subCacheSuffixes.append("symbols")
	for cacheSuffix in subCacheSuffixes:
		subCachePath = f"{mainCachePath}.{cacheSuffix}"
		cacheFileObject = open(subCachePath, mode="rb")
		cacheFileCtx = FileContext(cacheFileObject)
		subCaches.append(cacheFileCtx)
		subCachesFiles.append(cacheFileObject)
		pass
	return subCaches, subCachesFiles
def _openSubCaches ( mainCachePath : str , numSubCaches : int ) -> Tuple [ List [ FileContext ] , List [ BinaryIO ] ] : subCaches = [ ] subCachesFiles = [ ] subCacheSuffixes = [ i for i in range ( 1 , numSubCaches + 1 ) ] subCacheSuffixes . append ( "symbols" ) for cacheSuffix in subCacheSuffixes : subCachePath = f"{mainCachePath}.{cacheSuffix}" cacheFileObject = open ( subCachePath , mode = "rb" ) cacheFileCtx = FileContext ( cacheFileObject ) subCaches . append ( cacheFileCtx ) subCachesFiles . append ( cacheFileObject ) pass return subCaches , subCachesFiles
Create FileContext objects for each sub cache.
Create FileContext objects for each sub cache .
"""Create FileContext objects for each sub cache.

	Assumes that each sub cache has the same base name as the
	main cache, and that the suffixes are preserved.

	Also opens the symbols cache, and adds it to the end of
	the list.

	Returns:
		A list of subcaches, and their file objects, which must be closed!
	"""
A list of subcaches, and their file objects, which must be closed!
A list of subcaches and their file objects which must be closed!
mainCachePath
str
numSubCaches
int