code: def record_evaluation(eval_result):
      
      if not isinstance(eval_result, dict):
          raise TypeError('eval_result has to be a dictionary')
      eval_result.clear()
  
      def init(env):
          """internal function"""
          for k, _ in env.evaluation_result_list:
              pos = k.index('-')
              key = k[:pos]
              metric = k[pos + 1:]
              if key not in eval_result:
                  eval_result[key] = {}
              if metric not in eval_result[key]:
                  eval_result[key][metric] = []
  
      def callback(env):
          """internal function"""
          if not eval_result:
              init(env)
          for k, v in env.evaluation_result_list:
              pos = k.index('-')
              key = k[:pos]
              metric = k[pos + 1:]
              eval_result[key][metric].append(v)
      return callback
docs: Create a call back that records the evaluation history into **eval_result**.
  
      Parameters
      ----------
      eval_result : dict
         A dictionary to store the evaluation results.
  
      Returns
      -------
      callback : function
          The requested callback function.