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

Function ns_set

PC/layout/support/options.py:150–158  ·  view source on GitHub ↗
(ns, key, value=True)

Source from the content-addressed store, hash-verified

148
149
150def ns_set(ns, key, value=True):
151 k1 = key.replace("-", "_")
152 k2 = "include_{}".format(k1)
153 if hasattr(ns, k2):
154 setattr(ns, k2, value)
155 elif hasattr(ns, k1):
156 setattr(ns, k1, value)
157 else:
158 raise AttributeError("no argument named '{}'".format(k1))
159
160
161@public

Callers 1

update_presetsFunction · 0.85

Calls 2

replaceMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…