code: def test_create_tree_digraph(breast_cancer_split):
      X_train, _, y_train, _ = breast_cancer_split
  
      constraints = [-1, 1] * int(X_train.shape[1] / 2)
      gbm = lgb.LGBMClassifier(
          n_estimators=10,
          num_leaves=3,
          verbose=-1,
          monotone_constraints=constraints,
      )
      gbm.fit(X_train, y_train)
  
      with pytest.raises(IndexError):
          lgb.create_tree_digraph(gbm, tree_index=83)
  
      graph = lgb.create_tree_digraph(
          gbm,
          tree_index=3,
          show_info=["split_gain", "internal_value", "internal_weight"],
          name="Tree4",
          node_attr={"color": "red"},
      )
      graph.render(view=False)
      assert isinstance(graph, graphviz.Digraph)
      assert graph.name == "Tree4"
      assert len(graph.node_attr) == 1
      assert graph.node_attr["color"] == "red"
      assert len(graph.graph_attr) == 0
      assert len(graph.edge_attr) == 0
      graph_body = "".join(graph.body)
      assert "leaf" in graph_body
      assert "gain" in graph_body
      assert "value" in graph_body
      assert "weight" in graph_body
      assert "#ffdddd" in graph_body
      assert "#ddffdd" in graph_body
      assert "data" not in graph_body
      assert "count" not in graph_body
  
imports: import numpy
  import pandas
  import pytest
  from sklearn.model_selection import train_test_split
  import lightgbm
  from lightgbm.compat import GRAPHVIZ_INSTALLED, MATPLOTLIB_INSTALLED, PANDAS_INSTALLED, pd_DataFrame
  from .utils import load_breast_cancer, make_synthetic_regression
label_desc: Use image node_id 8 for calling a global function with example usage: test_create_tree_digraph(breast_cancer_split) without return types