MCPcopy Index your code
hub / github.com/python/cpython / is_resource

Function is_resource

Lib/importlib/resources/_functional.py:40–45  ·  view source on GitHub ↗

Return ``True`` if there is a resource named *name* in the package, Otherwise returns ``False``.

(anchor, *path_names)

Source from the content-addressed store, hash-verified

38
39
40def is_resource(anchor, *path_names):
41 """Return ``True`` if there is a resource named *name* in the package,
42
43 Otherwise returns ``False``.
44 """
45 return _get_resource(anchor, path_names).is_file()
46
47
48def contents(anchor, *path_names):

Callers 1

test_is_resourceMethod · 0.85

Calls 2

_get_resourceFunction · 0.85
is_fileMethod · 0.45

Tested by 1

test_is_resourceMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…