MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / include

Function include

tools/python-3.11.9-amd64/Lib/xml/etree/ElementInclude.py:116–128  ·  view source on GitHub ↗
(elem, loader=None, base_url=None,
            max_depth=DEFAULT_MAX_INCLUSION_DEPTH)

Source from the content-addressed store, hash-verified

114# @returns the node or its replacement if it was an XInclude node
115
116def include(elem, loader=None, base_url=None,
117 max_depth=DEFAULT_MAX_INCLUSION_DEPTH):
118 if max_depth is None:
119 max_depth = -1
120 elif max_depth < 0:
121 raise ValueError("expected non-negative depth or None for 'max_depth', got %r" % max_depth)
122
123 if hasattr(elem, 'getroot'):
124 elem = elem.getroot()
125 if loader is None:
126 loader = default_loader
127
128 _include(elem, loader, base_url, max_depth, set())
129
130
131def _include(elem, loader, base_url, max_depth, _parent_hrefs):

Callers

nothing calls this directly

Calls 3

_includeFunction · 0.85
getrootMethod · 0.80
setFunction · 0.50

Tested by

no test coverage detected