MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _replacer

Function _replacer

lib/matplotlib/__init__.py:1383–1396  ·  view source on GitHub ↗

Either returns ``data[value]`` or passes ``data`` back, converting any ``MappingView`` to a sequence.

(data, value)

Source from the content-addressed store, hash-verified

1381
1382
1383def _replacer(data, value):
1384 """
1385 Either returns ``data[value]`` or passes ``data`` back, converting any
1386 ``MappingView`` to a sequence.
1387 """
1388 try:
1389 # if key isn't a string don't bother
1390 if isinstance(value, str):
1391 # try to use __getitem__
1392 value = data[value]
1393 except Exception:
1394 # key does not exist, silently fall back to key
1395 pass
1396 return cbook.sanitize_sequence(value)
1397
1398
1399def _label_from_arg(y, default_name):

Callers 1

innerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…