MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / is_module_available

Function is_module_available

camel/utils/commons.py:220–233  ·  view source on GitHub ↗

r"""Check if a module is available for import. Args: module_name (str): The name of the module to check for availability. Returns: bool: True if the module can be imported, False otherwise.

(module_name: str)

Source from the content-addressed store, hash-verified

218
219
220def is_module_available(module_name: str) -> bool:
221 r"""Check if a module is available for import.
222
223 Args:
224 module_name (str): The name of the module to check for availability.
225
226 Returns:
227 bool: True if the module can be imported, False otherwise.
228 """
229 try:
230 importlib.import_module(module_name)
231 return True
232 except ImportError:
233 return False
234
235
236def api_keys_required(

Callers 1

wrapperFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected