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

Function default_loader

Lib/xml/etree/ElementInclude.py:87–96  ·  view source on GitHub ↗
(href, parse, encoding=None)

Source from the content-addressed store, hash-verified

85# @throws OSError If the loader fails to load the resource.
86
87def default_loader(href, parse, encoding=None):
88 if parse == "xml":
89 with open(href, 'rb') as file:
90 data = ElementTree.parse(file).getroot()
91 else:
92 if not encoding:
93 encoding = 'UTF-8'
94 with open(href, 'r', encoding=encoding) as file:
95 data = file.read()
96 return data
97
98##
99# Expand XInclude directives.

Callers

nothing calls this directly

Calls 4

getrootMethod · 0.80
openFunction · 0.50
parseMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…