code: def record_evaluation(
      eval_result: Dict[str, Dict[str, List[Any]]]
  ) -> Callable:
      """Create a callback that records the evaluation history into ``eval_result``.
  
      Parameters
      ----------
      eval_result : dict
          Dictionary used to store all evaluation results of all validation sets.
          This should be initialized outside of your call to ``record_evaluation()`` and should be empty.
          Any initial contents of the dictionary will be deleted.
  
          .. rubric:: Example
  
          With two validation sets named 'eval' and 'train', and one evaluation metric named 'logloss'
          this dictionary after finishing a model training process will have the following structure:
  
          .. code-block::
  
              {
               'train':
                   {
                    'logloss': [0.48253, 0.35953, ...]
                   },
               'eval':
                   {
                    'logloss': [0.480385, 0.357756, ...]
                   }
              }
  
      Returns
      -------
      callback : _RecordEvaluationCallback
          The callback that records the evaluation history into the passed dictionary.
      """
      return _RecordEvaluationCallback(eval_result=eval_result)
  
imports: from collections import OrderedDict
  from dataclasses import dataclass
  from functools import partial
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union
  from .basic import Booster, _ConfigAliases, _LGBM_BoosterEvalMethodResultType, _LGBM_BoosterEvalMethodResultWithStandardDeviationType, _log_info, _log_warning
label_desc: Use image node_id 3 for calling a global function with example usage: record_evaluation(eval_result) and returns: _RecordEvaluationCallback