code: def test_tweedie_convergence(max_depth, split_criterion):
      np.random.seed(33)
      bootstrap = None
      max_features = 1.0
      n_estimators = 1
      min_impurity_decrease = 1e-5
      n_datapoints = 1000
      tweedie = {
          "poisson": {
              "power": 1,
              "gen": np.random.poisson,
              "args": [0.01],
          },
          "gamma": {"power": 2, "gen": np.random.gamma, "args": [2.0]},
          "inverse_gaussian": {
              "power": 3,
              "gen": np.random.wald,
              "args": [0.1, 2.0],
          },
      }
      # generating random dataset with tweedie distribution
      X = np.random.random((n_datapoints, 4)).astype(np.float32)
      y = tweedie[split_criterion]["gen"](
          *tweedie[split_criterion]["args"], size=n_datapoints
      ).astype(np.float32)
  
      tweedie_preds = (
          curfr(
              split_criterion=split_criterion,
              max_depth=max_depth,
              n_estimators=n_estimators,
              bootstrap=bootstrap,
              max_features=max_features,
              min_impurity_decrease=min_impurity_decrease,
          )
          .fit(X, y)
          .predict(X)
      )
      mse_preds = (
          curfr(
              split_criterion=2,
              max_depth=max_depth,
              n_estimators=n_estimators,
              bootstrap=bootstrap,
              max_features=max_features,
              min_impurity_decrease=min_impurity_decrease,
          )
          .fit(X, y)
          .predict(X)
      )
      # y should not be non-positive for mean_poisson_deviance
      mask = mse_preds > 0
      mse_tweedie_deviance = mean_tweedie_deviance(
          y[mask],
          mse_preds[mask],
          power=tweedie[split_criterion]["power"],
      )
      tweedie_tweedie_deviance = mean_tweedie_deviance(
          y[mask],
          tweedie_preds[mask],
          power=tweedie[split_criterion]["power"],
      )
  
      # model trained on tweedie data with
      # tweedie criterion must perform better on tweedie loss
      assert mse_tweedie_deviance >= tweedie_tweedie_deviance
  
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 6 for calling a global function with example usage: test_tweedie_convergence(max_depth, split_criterion) without return types