code: def assert_refit(refit, expected_metric, expected_greater_is_better):
      """Checks if `refit` is initialized with
          metric = expected_metric,
          and greater_is_better = expected_greater_is_better.
  
      Parameters
      ----------
      refit : callable
          `refit` callable to check
      expected_metric : `str`
          expected metric used to define ``refit``
      expected_greater_is_better : `bool`
          expected greater_is_better used to define ``refit``
      """
      expected_index = 1 if expected_greater_is_better else 0
      assert (
          refit(
              results={
                  f"mean_test_{expected_metric}": np.array([0.0, 1.0])
              }
          )
          == expected_index
      )
  
imports: import warnings
  from functools import partial
  from typing import Optional
  import numpy
  import pandas
  from sklearn.model_selection import RandomizedSearchCV
  from sklearn.pipeline import Pipeline
  from greykite.common.constants import ACTUAL_COL
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTION_BAND_COVERAGE
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.evaluation import fraction_outside_tolerance
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import assert_eval_function_equal
  from greykite.framework.constants import FRACTION_OUTSIDE_TOLERANCE_NAME
  from greykite.framework.output.univariate_forecast import UnivariateForecast
  from greykite.framework.pipeline.pipeline import validate_pipeline_input
  from greykite.framework.pipeline.utils import get_score_func_with_aggregation
  from greykite.framework.utils.result_summary import summarize_grid_search_results
  from greykite.sklearn.estimator.simple_silverkite_estimator import SimpleSilverkiteEstimator
  from greykite.sklearn.sklearn_scorer import _PredictScorerDF
label_desc: Use image node_id 1 for calling a global function with example usage: assert_refit(refit, expected_metric, expected_greater_is_better) without return types