MCPcopy Index your code
hub / github.com/pyscript/pyscript / _relate

Function _relate

core/src/stdlib/pyscript/flatted.py:105–112  ·  view source on GitHub ↗
(known, input, value)

Source from the content-addressed store, hash-verified

103
104
105def _relate(known, input, value):
106 if _is_string(value) or _is_array(value) or _is_object(value):
107 try:
108 return known.value[known.key.index(value)]
109 except:
110 return _index(known, input, value)
111
112 return value
113
114
115def _transform(known, input, value):

Callers 1

_transformFunction · 0.85

Calls 5

_is_stringFunction · 0.85
_is_arrayFunction · 0.85
_is_objectFunction · 0.85
_indexFunction · 0.85
indexMethod · 0.80

Tested by

no test coverage detected