easydel.utils.lazy_import

easydel.utils.lazy_import#

class easydel.utils.lazy_import.DummyObject[source]#

Bases: type

Metaclass for the dummy objects. Any class inheriting from it will return the ImportError generated by requires_backend each time a user tries to access any method of that class.

class easydel.utils.lazy_import.LazyModule(name: str, module_file: str, import_structure: Dict[FrozenSet[str], Dict[str, Set[str]]], module_spec: ModuleSpec = None, extra_objects: Dict[str, object] = None)[source]#

Bases: module

easydel.utils.lazy_import.is_package_available(package_name: str) bool[source]#

Checks if a package is available in the current Python environment.

Parameters

package_name – The name of the package to check (e.g., “numpy”).

Returns

True if the package is available, False otherwise.