(key, value)
return lambda event, data: data[key] == value
Generates a check function for a certain key-value pair.

    Creates and returns a function that takes two arguments ``(event, data)``
    and checks ``data[key]`` and ``value`` for equality.

    This is supposed to be used as a check function generator for the
    ``yield`` statements in tasks.

    Example:
        Wait for the next ``player_join`` event that has
        its ``name`` set to ``Bob``, i.e. ``data = {'name': 'Bob'}``.

        >>> def my_task():
        ...     yield 'player_join', check_key('name', 'Bob')
Generates a check function for a certain key-value pair.
Generates a check function for a certain key - value pair .
def check_key(key, value):
    """Generates a check function for a certain key-value pair.

    Creates and returns a function that takes two arguments ``(event, data)``
    and checks ``data[key]`` and ``value`` for equality.

    This is supposed to be used as a check function generator for the
    ``yield`` statements in tasks.

    Example:
        Wait for the next ``player_join`` event that has
        its ``name`` set to ``Bob``, i.e. ``data = {'name': 'Bob'}``.

        >>> def my_task():
        ...     yield 'player_join', check_key('name', 'Bob')
    """
    return lambda event, data: data[key] == value
def check_key ( key , value ) : return lambda event , data : data [ key ] == value