docs: def build_node_data_search(key: str, data_predicate: Callable[[Any], bool]) -> NodePredicate:  # noqa: D202
      """Build a filter for nodes whose associated data with the given key passes the given predicate.
  
      :param key: The node data dictionary key to check
      :param data_predicate: The filter to apply to the node data dictionary
      """
  
      def node_data_filter(_: BELGraph, node: BaseEntity) -> bool:
          """Pass if the given node has a given data annotated and passes the contained filter."""
          value = node.get(key)
          return value is not None and data_predicate(value)
  
      return node_data_filter