code: def test_degenerate_cases():
      n_samples = 100
      cuml_model = curfr(
          max_features=1.0,
          max_samples=0.1,
          n_bins=128,
          min_samples_leaf=2,
          random_state=123,
          n_streams=1,
          n_estimators=10,
          max_leaves=-1,
          max_depth=16,
          accuracy_metric="mse",
      )
      # Attempt to import un-fitted model
      with pytest.raises(NotFittedError):
          TreeExplainer(model=cuml_model)
  
      # Depth 0 trees
      rng = np.random.default_rng(seed=0)
      X = rng.standard_normal(size=(n_samples, 8), dtype=np.float32)
      y = np.ones(shape=(n_samples,), dtype=np.float32)
      cuml_model.fit(X, y)
      explainer = TreeExplainer(model=cuml_model)
      out = explainer.shap_values(X)
      # Since the output is always 1.0 no matter the input, SHAP values for all
      # features are zero, as feature values don't have any effect on the output.
      # The bias (expected_value) is 1.0.
      assert np.all(out == 0)
      assert explainer.expected_value == 1.0
  
imports: from cuml.testing.utils import as_type
  import cuml
  from cuml.ensemble import RandomForestClassifier
  from cuml.ensemble import RandomForestRegressor
  from cuml.common.exceptions import NotFittedError
  from cuml.internals.import_utils import has_sklearn
  from cuml.internals.import_utils import has_lightgbm, has_shap
  from cuml.explainer.tree_shap import TreeExplainer
  from hypothesis import given, settings, assume, HealthCheck, strategies
  from cuml.internals.safe_imports import gpu_only_import
  import json
  import pytest
  import treelite
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 7 for calling a global function with example usage: test_degenerate_cases() without return types