code: def test_export_graphviz():
      """Check output of a simple program to Graphviz"""
  
      params = {
          "function_set": [add2, sub2, mul2, div2],
          "arities": {2: [add2, sub2, mul2, div2]},
          "init_depth": (2, 6),
          "init_method": "half and half",
          "n_features": 10,
          "const_range": (-1.0, 1.0),
          "metric": "mean absolute error",
          "p_point_replace": 0.05,
          "parsimony_coefficient": 0.1,
      }
      random_state = check_random_state(415)
  
      # Test for a small program
      test_gp = [mul2, div2, 8, 1, sub2, 9, 0.5]
      gp = _Program(
          random_state=random_state, program=test_gp, **params
      )
      output = gp.export_graphviz()
      tree = (
          "digraph program {\n"
          "node [style=filled]\n"
          '0 [label="mul", fillcolor="#136ed4"] ;\n'
          '1 [label="div", fillcolor="#136ed4"] ;\n'
          '2 [label="X8", fillcolor="#60a6f6"] ;\n'
          '3 [label="X1", fillcolor="#60a6f6"] ;\n'
          "1 -> 3 ;\n1 -> 2 ;\n"
          '4 [label="sub", fillcolor="#136ed4"] ;\n'
          '5 [label="X9", fillcolor="#60a6f6"] ;\n'
          '6 [label="0.500", fillcolor="#60a6f6"] ;\n'
          "4 -> 6 ;\n4 -> 5 ;\n0 -> 4 ;\n0 -> 1 ;\n}"
      )
      assert output == tree
  
      # Test with feature names
      params["feature_names"] = [str(n) for n in range(10)]
      gp = _Program(
          random_state=random_state, program=test_gp, **params
      )
      output = gp.export_graphviz()
      tree = tree.replace("X", "")
      assert output == tree
  
      # Test with fade_nodes
      params["feature_names"] = None
      gp = _Program(
          random_state=random_state, program=test_gp, **params
      )
      output = gp.export_graphviz(fade_nodes=[0, 1, 2, 3])
      tree = (
          "digraph program {\n"
          "node [style=filled]\n"
          '0 [label="mul", fillcolor="#cecece"] ;\n'
          '1 [label="div", fillcolor="#cecece"] ;\n'
          '2 [label="X8", fillcolor="#cecece"] ;\n'
          '3 [label="X1", fillcolor="#cecece"] ;\n'
          "1 -> 3 ;\n1 -> 2 ;\n"
          '4 [label="sub", fillcolor="#136ed4"] ;\n'
          '5 [label="X9", fillcolor="#60a6f6"] ;\n'
          '6 [label="0.500", fillcolor="#60a6f6"] ;\n'
          "4 -> 6 ;\n4 -> 5 ;\n0 -> 4 ;\n0 -> 1 ;\n}"
      )
      assert output == tree
  
      # Test a degenerative single-node program
      test_gp = [1]
      gp = _Program(
          random_state=random_state, program=test_gp, **params
      )
      output = gp.export_graphviz()
      tree = (
          "digraph program {\n"
          "node [style=filled]\n"
          '0 [label="X1", fillcolor="#60a6f6"] ;\n}'
      )
      assert output == tree
  
imports: import pickle
  import pytest
  import sys
  from io import StringIO
  import numpy
  from scipy.stats import pearsonr, spearmanr
  from sklearn.datasets import load_diabetes, load_breast_cancer
  from sklearn.metrics import mean_absolute_error
  from sklearn.model_selection import GridSearchCV
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import StandardScaler
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.utils._testing import assert_almost_equal
  from sklearn.utils._testing import assert_array_equal
  from sklearn.utils._testing import assert_array_almost_equal
  from sklearn.utils._testing import assert_raises
  from sklearn.utils.validation import check_random_state
  from gplearn.genetic import SymbolicClassifier, SymbolicRegressor
  from gplearn.genetic import SymbolicTransformer
  from gplearn.fitness import weighted_pearson, weighted_spearman
  from gplearn._program import _Program
  from gplearn.fitness import _fitness_map
  from gplearn.functions import add2, sub2, mul2, div2, sqrt1, log1, abs1, max2, min2
  from gplearn.functions import _Function
label_desc: Use image node_id 6 for calling a global function with example usage: test_export_graphviz() without return types