MCPcopy Index your code
hub / github.com/numpy/numpy / unreplace_parenthesis

Function unreplace_parenthesis

numpy/f2py/symbolic.py:1261–1269  ·  view source on GitHub ↗

Inverse of replace_parenthesis.

(s, d)

Source from the content-addressed store, hash-verified

1259
1260
1261def unreplace_parenthesis(s, d):
1262 """Inverse of replace_parenthesis.
1263 """
1264 for k, v in d.items():
1265 p = _get_parenthesis_kind(k)
1266 left = {'ROUND': '(', 'SQUARE': '[', 'CURLY': '{', 'ROUNDDIV': '(/'}[p]
1267 right = {'ROUND': ')', 'SQUARE': ']', 'CURLY': '}', 'ROUNDDIV': '/)'}[p]
1268 s = s.replace(k, left + v + right)
1269 return s
1270
1271
1272def fromstring(s, language=Language.C):

Callers 1

restoreMethod · 0.85

Calls 3

_get_parenthesis_kindFunction · 0.85
itemsMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…