def dict_value_hint(key, mapper=None):
    """Returns a function that takes a dictionary and returns value of
    particular key. The returned value can be optionally processed by `mapper`
    function.

    To be used as a type hint in :class:`OneOf`.
    """
    if mapper is None:
        mapper = identity

    def hinter(data):
        return mapper(data.get(key))

    return hinter
def dict_value_hint ( key , mapper = None ) : if mapper is None : mapper = identity def hinter ( data ) : return mapper ( data . get ( key ) ) return hinter
Returns a function that takes a dictionary and returns value of
    particular key. The returned value can be optionally processed by `mapper`
    function.

    To be used as a type hint in :class:`OneOf`.