mmeutils.common package

Module contents

Common Utility Functions

mmeutils.common.batch_list(input_list: List[Any], batch_size: int) Iterable[List[Any]]

Yields successive n-sized batches from input_list.

Parameters:
  • input_list (List[Any]) – An arbitrary list to split into equal-sized chunks.

  • batch_size (int) – The number of elements in a chunk to split the list into. Batch size must be >= 1.

Returns:

An iterable of sub-lists of size batch_size.

Return type:

Iterable[List[Any]]

mmeutils.common.open_location(filepath: str | Path) bool

Opens a directory in the platform’s respective file manager application.

Parameters:

filepath (str | Path) – The directory path.

Returns:

True when the folder was opened or False otherwise.

Return type:

bool