MCPcopy Create free account
hub / github.com/numpy/numpy / unreplace_parenthesis

Function unreplace_parenthesis

numpy/f2py/symbolic.py:1260–1268  ·  view source on GitHub ↗

Inverse of replace_parenthesis.

(s, d)

Source from the content-addressed store, hash-verified

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

Callers 1

restoreMethod · 0.85

Calls 2

_get_parenthesis_kindFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected