INNER CODE UNIT · Python
check_module_import_and_constructor
erikbern/ann-benchmarks · ann_benchmarks/main.py:200
def check_module_import_and_constructor(df: Definition) -> bool:
"""
Verifies if the algorithm module can be imported and its constructor exists.
This function checks if the module specified in the definition can be imported.
Additionally, it verifies if the constructor for the algorithm exists within the
imported module.
Args:
df (Definition): A definition object containing the module and constructor
for the algorithm.
Returns:
bool: True if the module can be imported and the constructor exists, False
otherwise.
"""
status = algorithm_status(df)
if status == InstantiationStatus.NO_CONSTRUCTOR: