code: def test_custom_functions():
      """Test the custom programs example works"""
  
      rng = check_random_state(0)
      diabetes = load_diabetes()
      perm = rng.permutation(diabetes.target.size)
      diabetes.data = diabetes.data[perm]
      diabetes.target = diabetes.target[perm]
  
      def logic(x1, x2, x3, x4):
          return np.where(x1 > x2, x3, x4)
  
      logical = make_function(function=logic, name="logical", arity=4)
  
      function_set = ["add", "sub", "mul", "div", logical]
      gp = SymbolicTransformer(
          generations=2,
          population_size=2000,
          hall_of_fame=100,
          n_components=10,
          function_set=function_set,
          parsimony_coefficient=0.0005,
          max_samples=0.9,
          random_state=0,
      )
  
      gp.fit(diabetes.data[:300, :], diabetes.target[:300])
  
      expected = (
          "add(X3, logical(div(X5, sub(X5, X5)), "
          "add(X9, -0.621), X8, X4))"
      )
      assert gp._programs[0][3].__str__() == expected
  
      dot_data = gp._programs[0][3].export_graphviz()
      expected = (
          'digraph program {\nnode [style=filled]\n0 [label="add", '
          'fillcolor="#136ed4"] ;\n1 [label="X3", fillcolor="#60a6f6"] ;'
          '\n2 [label="logical", fillcolor="#136ed4"] ;\n3 [label="div",'
          ' fillcolor="#136ed4"] ;\n4 [label="X5", fillcolor="#60a6f6"] '
          ';\n5 [label="sub", fillcolor="#136ed4"] ;\n6 [label="X5", '
          'fillcolor="#60a6f6"] ;\n7 [label="X5", fillcolor="#60a6f6"] '
          ';\n5 -> 7 ;\n5 -> 6 ;\n3 -> 5 ;\n3 -> 4 ;\n8 [label="add", '
          'fillcolor="#136ed4"] ;\n9 [label="X9", fillcolor="#60a6f6"] '
          ';\n10 [label="-0.621", fillcolor="#60a6f6"] ;\n8 -> 10 ;\n8 '
          '-> 9 ;\n11 [label="X8", fillcolor="#60a6f6"] ;\n12 '
          '[label="X4", fillcolor="#60a6f6"] ;\n2 -> 12 ;\n2 -> 11 ;\n2 '
          "-> 8 ;\n2 -> 3 ;\n0 -> 2 ;\n0 -> 1 ;\n}"
      )
      assert dot_data == expected
  
file_path: gplearn/gplearn/tests/test_examples.py
imports: import numpy
  from sklearn.datasets import load_diabetes, load_breast_cancer
  from sklearn.datasets import make_moons, make_circles, make_classification
  from sklearn.linear_model import Ridge
  from sklearn.metrics import roc_auc_score
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils._testing import assert_almost_equal
  from sklearn.utils.validation import check_random_state
  from gplearn.genetic import SymbolicClassifier, SymbolicRegressor
  from gplearn.genetic import SymbolicTransformer
  from gplearn.functions import make_function
label_desc: Use image node_id 3 for calling a global function with example usage: test_custom_functions() and returns: np