code: def _create_child_runs_for_parameter_search(
      autologging_client,
      cv_estimator,
      parent_run,
      max_tuning_runs,
      child_tags=None,
  ):
      """
      Creates a collection of child runs for a parameter search training session.
      Runs are reconstructed from the `cv_results_` attribute of the specified trained
      parameter search estimator - `cv_estimator`, which provides relevant performance
      metrics for each point in the parameter search space. One child run is created
      for each point in the parameter search space. For additional information, see
      `https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html`_.
  
      :param autologging_client: An instance of `MlflowAutologgingQueueingClient` used for
                                 efficiently logging run data to MLflow Tracking.
      :param cv_estimator: The trained parameter search estimator for which to create
                           child runs.
      :param parent_run: A py:class:`mlflow.entities.Run` object referring to the parent
                         parameter search run for which child runs should be created.
      :param child_tags: An optional dictionary of MLflow tag keys and values to log
                         for each child run.
      """
      import pandas as pd
  
      def first_custom_rank_column(df):
          column_names = df.columns.values
          for col_name in column_names:
              if "rank_test_" in col_name:
                  return col_name
  
      # Use the start time of the parent parameter search run as a rough estimate for the
      # start time of child runs, since we cannot precisely determine when each point
      # in the parameter search space was explored
      child_run_start_time = parent_run.info.start_time
      child_run_end_time = get_current_time_millis()
  
      seed_estimator = cv_estimator.estimator
      # In the unlikely case that a seed of a parameter search estimator is,
      # itself, a parameter search estimator, we should avoid logging the untuned
      # parameters of the seeds's seed estimator
      should_log_params_deeply = not _is_parameter_search_estimator(
          seed_estimator
      )
      # Each row of `cv_results_` only provides parameters that vary across
      # the user-specified parameter grid. In order to log the complete set
      # of parameters for each child run, we fetch the parameters defined by
      # the seed estimator and update them with parameter subset specified
      # in the result row
      base_params = seed_estimator.get_params(
          deep=should_log_params_deeply
      )
      cv_results_df = pd.DataFrame.from_dict(cv_estimator.cv_results_)
  
      if max_tuning_runs is None:
          cv_results_best_n_df = cv_results_df
      else:
          rank_column_name = "rank_test_score"
          if rank_column_name not in cv_results_df.columns.values:
              rank_column_name = first_custom_rank_column(cv_results_df)
              warnings.warn(
                  f"Top {max_tuning_runs} child runs will be created based on ordering in "
                  f"{rank_column_name} column.  You can choose not to limit the number of "
                  "child runs created by setting `max_tuning_runs=None`."
              )
          cv_results_best_n_df = cv_results_df.nsmallest(
              max_tuning_runs, rank_column_name
          )
          # Log how many child runs will be created vs omitted.
          _log_child_runs_info(max_tuning_runs, len(cv_results_df))
  
      for _, result_row in cv_results_best_n_df.iterrows():
          tags_to_log = dict(child_tags) if child_tags else {}
          tags_to_log.update(
              {MLFLOW_PARENT_RUN_ID: parent_run.info.run_id}
          )
          tags_to_log.update(_get_estimator_info_tags(seed_estimator))
          pending_child_run_id = autologging_client.create_run(
              experiment_id=parent_run.info.experiment_id,
              start_time=child_run_start_time,
              tags=tags_to_log,
          )
  
          params_to_log = dict(base_params)
          params_to_log.update(result_row.get("params", {}))
          autologging_client.log_params(
              run_id=pending_child_run_id, params=params_to_log
          )
  
          # Parameters values are recorded twice in the set of search `cv_results_`:
          # once within a `params` column with dictionary values and once within
          # a separate dataframe column that is created for each parameter. To prevent
          # duplication of parameters, we log the consolidated values from the parameter
          # dictionary column and filter out the other parameter-specific columns with
          # names of the form `param_{param_name}`. Additionally, `cv_results_` produces
          # metrics for each training split, which is fairly verbose; accordingly, we filter
          # out per-split metrics in favor of aggregate metrics (mean, std, etc.)
          excluded_metric_prefixes = ["param", "split"]
          metrics_to_log = {
              key: value
              for key, value in result_row.items()
              if not any(
                  key.startswith(prefix)
                  for prefix in excluded_metric_prefixes
              )
              and isinstance(value, Number)
          }
          autologging_client.log_metrics(
              run_id=pending_child_run_id,
              metrics=metrics_to_log,
          )
  
          autologging_client.set_terminated(
              run_id=pending_child_run_id, end_time=child_run_end_time
          )
  
imports: import collections
  import inspect
  import logging
  import pkgutil
  import platform
  import warnings
  from copy import deepcopy
  from importlib import import_module
  from numbers import Number
  from operator import itemgetter
  import numpy
  from packaging.version import Version
  from mlflow import MlflowClient
  from mlflow.utils.arguments_utils import _get_arg_names
  from mlflow.utils.file_utils import TempDir
  from mlflow.utils.mlflow_tags import MLFLOW_PARENT_RUN_ID
  from mlflow.utils.time import get_current_time_millis
label_desc: Use image node_id 20 for calling a global function with example usage: _create_child_runs_for_parameter_search(autologging_client, cv_estimator, parent_run, max_tuning_runs, child_tags) and returns: col_name