code: def test_given_a_directed_graph_when_checking_if_a_node_is_root_then_returns_true_for_root_nodes_and_false_for_non_root_nodes():
      graph = nx.DiGraph([("X", "Z"), ("Y", "Z")])
      assert is_root_node(graph, "X") == True
      assert is_root_node(graph, "Y") == True
      assert is_root_node(graph, "Z") == False
  
file_path: dowhy/tests/gcm/test_graph.py
imports: import networkx
  import numpy
  import pandas
  import pytest
  from flaky import flaky
  from pytest import approx
  from dowhy.gcm import AdditiveNoiseModel, EmpiricalDistribution, ProbabilisticCausalModel, draw_samples, fit
  from dowhy.gcm.ml import create_linear_regressor
  from dowhy.graph import is_root_node
label_desc: Use image node_id 3 for calling a global function with example usage: test_given_a_directed_graph_when_checking_if_a_node_is_root_then_returns_true_for_root_nodes_and_false_for_non_root_nodes() without return types