code: def format_anthropic_hh(ex, rng):
      hard_label = int(rng.random() < 0.5)
      txt = ex["chosen"] if hard_label else ex["rejected"]
      return dict(txt=txt, hard_label=hard_label)
  
file_path: weak-to-strong/weak_to_strong/datasets.py
imports: import functools
  from dataclasses import dataclass
  from random import Random
  from typing import Any, Callable, Optional
  from datasets import Dataset
  from datasets import load_dataset
label_desc: Use image node_id 7 for calling a global function with example usage: format_anthropic_hh(ex, rng) and returns: dict