MCPcopy Index your code
hub / github.com/LabPy/lantz / to_callable

Method to_callable

lantz/processors.py:292–301  ·  view source on GitHub ↗
(cls, obj)

Source from the content-addressed store, hash-verified

290
291 @classmethod
292 def to_callable(cls, obj):
293 if isinstance(obj, dict):
294 obj = cls.__reversed_cache.setdefault(id(obj),
295 {value: key for key, value
296 in obj.items()})
297 return get_mapping(obj)
298 if isinstance(obj, set):
299 return check_membership(obj)
300 raise TypeError('ReverseMapProcessor argument must be a dict or a callable, '
301 'not {}'.format(obj))
302
303
304class RangeProcessor(Processor):

Callers

nothing calls this directly

Calls 3

get_mappingFunction · 0.85
check_membershipFunction · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected