Either returns ``data[value]`` or passes ``data`` back, converting any ``MappingView`` to a sequence.
(data, value)
| 1381 | |
| 1382 | |
| 1383 | def _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 | |
| 1399 | def _label_from_arg(y, default_name): |
no outgoing calls
no test coverage detected
searching dependent graphs…