MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeText-parser / _package_available

Function _package_available

src/codetext/utils/imports.py:6–15  ·  view source on GitHub ↗

Check if a package is available in your environment. .. code-block:: python >>> _package_available('os') True >>> _package_available('bla') False

(package_name: str)

Source from the content-addressed store, hash-verified

4
5
6def _package_available(package_name: str) -> bool:
7 """Check if a package is available in your environment.
8 .. code-block:: python
9
10 >>> _package_available('os')
11 True
12 >>> _package_available('bla')
13 False
14 """
15 return find_spec(package_name) is not None
16
17
18def module_available(module_path: str) -> bool:

Callers 1

module_availableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected