code: def test_rf_regression_with_identical_labels(split_criterion):
      X = np.array(
          [[-1, 0], [0, 1], [2, 0], [0, 3], [-2, 0]], dtype=np.float32
      )
      y = np.array([1, 1, 1, 1, 1], dtype=np.float32)
      # Degenerate case: all labels are identical.
      # RF Regressor must not create any split. It must yield an empty tree
      # with only the root node.
      clf = curfr(
          max_features=1.0,
          max_samples=1.0,
          n_bins=5,
          bootstrap=False,
          split_criterion=split_criterion,
          min_samples_leaf=1,
          min_samples_split=2,
          random_state=0,
          n_streams=1,
          n_estimators=1,
          max_depth=1,
      )
      clf.fit(X, y)
      model_dump = json.loads(clf.get_json())
      assert len(model_dump) == 1
      expected_dump = {
          "nodeid": 0,
          "leaf_value": [1.0],
          "instance_count": 5,
      }
      assert model_dump[0] == expected_dump
  
imports: import treelite
  from sklearn.model_selection import train_test_split
  from sklearn.datasets import fetch_california_housing, make_classification, make_regression, load_iris, load_breast_cancer
  from sklearn.metrics import accuracy_score, mean_squared_error, mean_tweedie_deviance
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.ensemble import RandomForestClassifier
  import cuml.internals.logger
  from cuml.testing.utils import get_handle, unit_param, quality_param, stress_param
  from cuml.metrics import r2_score
  from cuml.ensemble import RandomForestRegressor
  from cuml.ensemble import RandomForestClassifier
  import cuml
  from cuml.internals.safe_imports import gpu_only_import_from
  import os
  import json
  import random
  from cuml.internals.safe_imports import cpu_only_import
  import pytest
  import warnings
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 28 for calling a global function with example usage: test_rf_regression_with_identical_labels(split_criterion) without return types