code: def has_directed_path(graph: nx.DiGraph, nodes1, nodes2):
      """Checks if there is any directed path between two sets of nodes.
  
      Currently only supports singleton sets.
      """
      # dpaths = self.get_all_directed_paths(nodes1, nodes2)
      # return len(dpaths) > 0
      return nx.has_path(graph, nodes1[0], nodes2[0])
  
imports: import itertools
  import logging
  import re
  from abc import abstractmethod
  from typing import Any, List, Protocol
  import networkx
  from networkx.algorithms.dag import has_cycle
  from dowhy.utils.api import parse_state
  from dowhy.utils.graph_operations import daggity_to_dot
label_desc: Use image node_id 16 for calling a global function with example usage: has_directed_path(graph, nodes1, nodes2) and returns: nx