def build_node_data_search(key, data_predicate):
    """Pass for nodes who have the given key in their data dictionaries and whose associated values pass the given
    filter function.

    :param str key: The node data dictionary key to check
    :param data_predicate: The filter to apply to the node data dictionary
    :type data_predicate: (Any) -> bool
    :return: A node predicate
    :rtype: (pybel.BELGraph, BaseEntity) -> bool
    """

    def node_data_filter(graph, node):
        """Pass if the given node has a given data annotated and passes the contained filter.

        :type graph: pybel.BELGraph
        :type node: BaseEntity
        :return: If the node has the contained key in its data dictionary and passes the contained filter
        :rtype: bool
        """
        value = node.get(key)
        return value is not None and data_predicate(value)

    return node_data_filter