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

Function optimize

Tools/i18n/makelocalealias.py:115–127  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

113 # Additions are not mentioned
114
115def optimize(data):
116 locale_alias = locale.locale_alias
117 locale.locale_alias = data.copy()
118 for k, v in data.items():
119 del locale.locale_alias[k]
120 if locale.normalize(k) != v:
121 locale.locale_alias[k] = v
122 newdata = locale.locale_alias
123 errors = check(data)
124 locale.locale_alias = locale_alias
125 if errors:
126 sys.exit(1)
127 return newdata
128
129def check(data):
130 # Check that all alias definitions from the X11 file

Callers 1

makelocalealias.pyFile · 0.70

Calls 5

checkFunction · 0.70
copyMethod · 0.45
itemsMethod · 0.45
normalizeMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…