Return a new dictionary comprising of keys and values
    for which ``predicate`` returns True.

    :param predicate: Predicate taking key and value, or None

    .. versionchanged:: 0.0.2
       Renamed ``starfilteritems`` for consistency with :func:`starmapitems`.

def starfilteritems(predicate, dict_):
    """Return a new dictionary comprising of keys and values
    for which ``predicate`` returns True.

    :param predicate: Predicate taking key and value, or None

    .. versionchanged:: 0.0.2
       Renamed ``starfilteritems`` for consistency with :func:`starmapitems`.
    """
    ensure_mapping(dict_)

    if predicate is None:
        predicate = lambda k, v: all((k, v))
    else:
        ensure_callable(predicate)

    return dict_.__class__((k, v) for k, v in iteritems(dict_)
                           if predicate(k, v))