code: def test_catboost_metric_binary(requests_mock: Mocker):
      url = "http://fake_url2"
      mock_default_requests(requests_mock, url)
      search_task_id = mock_initial_search(requests_mock, url)
      mock_initial_progress(requests_mock, url, search_task_id)
      ads_search_task_id = mock_initial_summary(
          requests_mock,
          url,
          search_task_id,
      )
      mock_get_metadata(requests_mock, url, search_task_id)
      mock_get_task_metadata_v2(
          requests_mock,
          url,
          ads_search_task_id,
          ProviderTaskMetadataV2(
              features=[
                  FeaturesMetadataV2(
                      name="ads_feature1",
                      type="numerical",
                      source="etalon",
                      hit_rate=99.0,
                      shap_value=10.1,
                  ),
                  FeaturesMetadataV2(
                      name="feature1",
                      type="numerical",
                      source="etalon",
                      hit_rate=100.0,
                      shap_value=0.1,
                  ),
              ],
              hit_rate_metrics=HitRateMetrics(
                  etalon_row_count=10000,
                  max_hit_count=9900,
                  hit_rate=0.99,
                  hit_rate_percent=99.0,
              ),
              eval_set_metrics=[
                  ModelEvalSet(
                      eval_set_index=1,
                      hit_rate=1.0,
                      hit_rate_metrics=HitRateMetrics(
                          etalon_row_count=1000,
                          max_hit_count=1000,
                          hit_rate=1.0,
                          hit_rate_percent=100.0,
                      ),
                  ),
                  ModelEvalSet(
                      eval_set_index=2,
                      hit_rate=0.99,
                      hit_rate_metrics=HitRateMetrics(
                          etalon_row_count=1000,
                          max_hit_count=990,
                          hit_rate=0.99,
                          hit_rate_percent=99.0,
                      ),
                  ),
              ],
          ),
      )
      path_to_mock_features = os.path.join(
          FIXTURE_DIR, "features.parquet"
      )
      mock_raw_features(
          requests_mock, url, search_task_id, path_to_mock_features
      )
  
      validation_search_task_id = mock_validation_search(
          requests_mock, url, search_task_id
      )
      mock_validation_progress(
          requests_mock, url, validation_search_task_id
      )
      mock_validation_summary(
          requests_mock,
          url,
          search_task_id,
          ads_search_task_id,
          validation_search_task_id,
      )
      path_to_mock_validation_features = os.path.join(
          FIXTURE_DIR, "validation_features.parquet"
      )
      mock_validation_raw_features(
          requests_mock,
          url,
          validation_search_task_id,
          path_to_mock_validation_features,
      )
  
      df = pd.read_csv(os.path.join(FIXTURE_DIR, "input.csv"))
      df_train = df[0:500]
      X = df_train[["phone", "feature1"]]
      y = df_train["target"]
      eval_1 = df[500:750]
      eval_2 = df[750:1000]
      eval_X_1 = eval_1[["phone", "feature1"]]
      eval_y_1 = eval_1["target"]
      eval_X_2 = eval_2[["phone", "feature1"]]
      eval_y_2 = eval_2["target"]
      eval_set = [(eval_X_1, eval_y_1), (eval_X_2, eval_y_2)]
      enricher = FeaturesEnricher(
          search_keys={"phone": SearchKey.PHONE},
          endpoint=url,
          api_key="fake_api_key",
          logs_enabled=False,
      )
  
      with pytest.raises(
          ValidationError, match=bundle.get("metrics_unfitted_enricher")
      ):
          enricher.calculate_metrics()
  
      enriched_X = enricher.fit_transform(
          X, y, eval_set, calculate_metrics=False
      )
  
      assert len(enriched_X) == len(X)
  
      estimator = CatBoostClassifier(random_seed=42, verbose=False)
      metrics_df = enricher.calculate_metrics(
          estimator=estimator, scoring="roc_auc"
      )
      assert metrics_df is not None
      print(metrics_df)
  
      assert metrics_df.loc[0, segment_header] == train_segment
      assert metrics_df.loc[0, rows_header] == 500
      assert metrics_df.loc[0, target_mean_header] == 0.51
      assert metrics_df.loc[0, baseline_gini] == approx(0.023101)
      assert metrics_df.loc[0, enriched_gini] == approx(0.090344)
      assert metrics_df.loc[0, uplift] == approx(0.067243)
  
      assert metrics_df.loc[1, segment_header] == eval_1_segment
      assert metrics_df.loc[1, rows_header] == 250
      assert metrics_df.loc[1, target_mean_header] == 0.452
      assert metrics_df.loc[1, baseline_gini] == approx(-0.016188)
      assert metrics_df.loc[1, enriched_gini] == approx(0.014947)
      assert metrics_df.loc[1, uplift] == approx(0.031135)
  
      assert metrics_df.loc[2, segment_header] == eval_2_segment
      assert metrics_df.loc[2, rows_header] == 250
      assert metrics_df.loc[2, target_mean_header] == 0.536
      assert metrics_df.loc[2, baseline_gini] == approx(-0.017138)
      assert metrics_df.loc[2, enriched_gini] == approx(0.035666)
      assert metrics_df.loc[2, uplift] == approx(0.052805)
  
imports: import datetime
  import os
  import numpy
  import pandas
  import pytest
  from catboost import CatBoostClassifier
  from pandas.testing import assert_frame_equal
  from requests_mock.mocker import Mocker
  from sklearn.ensemble import RandomForestClassifier
  from upgini import FeaturesEnricher, SearchKey
  from upgini.errors import ValidationError
  from upgini.metadata import CVType, FeaturesMetadataV2, HitRateMetrics, ModelEvalSet, ProviderTaskMetadataV2
  from upgini.resource_bundle import bundle
  from upgini.search_task import SearchTask
  from .utils import mock_default_requests, mock_get_metadata, mock_get_task_metadata_v2, mock_initial_progress, mock_initial_search, mock_initial_summary, mock_raw_features, mock_validation_progress, mock_validation_raw_features, mock_validation_search, mock_validation_summary
label_desc: Use image node_id 6 for calling a global function with example usage: test_catboost_metric_binary(requests_mock) without return types