code: def record_mmlu_sample(
      prompt: Any,
      sampled: str,
      expected: str,
      extra_logging: dict,
  ):
      """
      Determines if sampled is correct, then logs to recorder. Additionally
      logs data in extra_logging dict
      """
      if sampled.startswith(expected):
          picked = expected
          correct = True
      else:
          picked = None
          correct = False
  
      results = {
          "prompt": prompt,
          "sampled": sampled,
          "expected": expected,
          "picked": picked,
          "correct": correct,
      }
      if extra_logging is not None:
          results.update(extra_logging)
  
      evals.record.record_metrics(**results)
      return picked
  
imports: from typing import Any, Sequence
  import evals
  from evals.record import Event
label_desc: Use image node_id 2 for calling a global function with example usage: record_mmlu_sample(prompt, sampled, expected, extra_logging) and returns: picked