code: def roc_pr_curve():
      air = h2o.import_file(
          pyunit_utils.locate(
              "smalldata/airlines/AirlinesTrain.csv.zip"
          )
      )
  
      # Constructing test and train sets by sampling (20/80)
      s = air[0].runif()
      air_train = air[s <= 0.8]
      air_valid = air[s > 0.8]
  
      myX = [
          "Origin",
          "Dest",
          "Distance",
          "UniqueCarrier",
          "fMonth",
          "fDayofMonth",
          "fDayOfWeek",
      ]
      myY = "IsDepDelayed"
  
      air_gbm = H2OGradientBoostingEstimator(
          distribution="bernoulli",
          ntrees=100,
          max_depth=3,
          learn_rate=0.01,
      )
      air_gbm.train(
          x=myX,
          y=myY,
          training_frame=air_train,
          validation_frame=air_valid,
      )
  
      # Plot ROC for valid set
      perf_valid = air_gbm.model_performance(valid=True)
      with TemporaryDirectory() as tmpdir:
          path1 = "{}/plot1.png".format(tmpdir)
          path2 = "{}/plot2.png".format(tmpdir)
          test_plot_result_saving(
              perf_valid.plot(type="roc", server=False),
              path2,
              perf_valid.plot(
                  type="roc", server=False, save_to_file=path1
              ),
              path1,
          )
  
          # Plot ROC for test set
          air_test = h2o.import_file(
              pyunit_utils.locate(
                  "smalldata/airlines/AirlinesTest.csv.zip"
              )
          )
          perf_test = air_gbm.model_performance(air_test)
  
          test_plot_result_saving(
              perf_test.plot(type="roc", server=False),
              path2,
              perf_test.plot(
                  type="roc", server=False, save_plot_path=path1
              ),
              path1,
          )
  
imports: import sys
  import matplotlib
  from h2o.automl import H2OAutoML
  from h2o.estimators import H2OGradientBoostingEstimator
  from h2o.exceptions import H2OError
  from h2o.transforms import H2OPCA
  import h2o
  from tests import pyunit_utils, test_plot_result_saving, TemporaryDirectory
  from h2o.estimators.glm import H2OGeneralizedLinearEstimator, H2OGeneralizedLinearEstimator
  from h2o.plot import decorate_plot_result, RAISE_ON_FIGURE_ACCESS
label_desc: Use image node_id 7 for calling a global function with example usage: roc_pr_curve() without return types