class_docstr: A protocol representing a directed graph as needed by graphical causal models.
  
  This protocol specifically defines a subset of the networkx.DiGraph class, which make that class automatically
  compatible with DirectedGraph. While in most cases a networkx.DiGraph is the class of choice when constructing
  a causal graph, anyone can choose to provide their own implementation of the DirectGraph interface.
class_docstr_tok: ["A","protocol","representing","a","directed","graph","as","needed","by","graphical","causal","models",".","This","protocol","specifically","defines","a","subset","of","the","networkx.DiGraph","class",",","which","make","that","class","automatically","compatible","with","DirectedGraph",".","While","in","most","cases","a","networkx.DiGraph","is","the","class","of","choice","when","constructing","a","causal","graph",",","anyone","can","choose","to","provide","their","own","implementation","of","the","DirectGraph","interface","."]
code: def predecessors(self, node):
      raise NotImplementedError
  
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 1 for calling the DirectedGraph obj's underlying member method code with example usage: obj.predecessors(node) without return types