class_docstr: Buffer to store the data from the games played by the MCTS agent.
code: def __getitem__(self, idx):
      i = 0
      while idx >= self.game_data[i]:
          idx -= self.game_data[i]
          i += 1
      states = torch.load(os.path.join(self.temp_dir, f"states_{i}.pt"))
      policies = torch.load(
          os.path.join(self.temp_dir, f"policies_{i}.pt")
      )
      rewards = torch.load(
          os.path.join(self.temp_dir, f"rewards_{i}.pt")
      )
      return (
          states[idx].to(self.device),
          get_scalars(states[idx], idx, with_bs=False).to(self.device),
          policies[idx].to(self.device).argmax(dim=-1),
          rewards[idx].to(self.device).reshape(1),
      )
  
imports: import json
  import os
  import shutil
  import tempfile
  from pathlib import Path
  from typing import List, Tuple
  import numpy
  import torch
  from torch.utils.data import Dataset
  from open_alpha_tensor.core.data.generation import generate_synthetic_data
  from open_alpha_tensor.core.data.utils import get_scalars, map_triplet_to_action
label_desc: Use image node_id 5 for calling the GameDataBuffer obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: states,  get_scalars,  policies,  rewards