"""Determine how to load the data sources based on their extensions.
Args:
sources:
list of str, the data sources to be loaded.
Raises:
UnknownExtensionError:
If the sources do not ends with .gz or .cache.
Returns:
None
"""
asserttype(sources)==list,"Please provides <class 'list'> as input data sources."
assertlen(sources)>=1,"Please provides at least one data source."
# default loader
extension=Path(sources[0]).suffix
ifextension==".gz":
return_load_files
ifextension==".cache":
return_load_caches
raiseUnknownExtensionError("Cannot determine the extension of the input data sources, please prepare files with the following extension: ('.gz' or '.cache').")