code: def test_create_contamination_stats():
      scenarios = [TEST_SCENARIO_1, TEST_SCENARIO_2]
      all_contamination_stats: AllContaminationStats
      all_contamination_stats = create_all_contamination_stats(
          light_scenarios=scenarios, n_values=N_VALUES
      )
  
      stats_1_key, stats_2_key, stats_3_key = (
          ContaminationStatsKey(
              metadata={
                  "light_scenario_key": TEST_SCENARIO_1.light_scenario_key,
                  "N": 5,
              }
          ),
          ContaminationStatsKey(
              metadata={
                  "light_scenario_key": TEST_SCENARIO_2.light_scenario_key,
                  "N": 5,
              }
          ),
          ContaminationStatsKey(
              metadata={
                  "light_scenario_key": TEST_SCENARIO_2.light_scenario_key,
                  "N": 13,
              }
          ),
      )
  
      assert (
          stats_1_key in all_contamination_stats
          and stats_2_key in all_contamination_stats
          and stats_3_key in all_contamination_stats
      )
  
      stats_1: ContaminationStats
      stats_2: ContaminationStats
      stats_3: ContaminationStats
      stats_1, stats_2, stats_3 = (
          all_contamination_stats[stats_1_key],
          all_contamination_stats[stats_2_key],
          all_contamination_stats[stats_3_key],
      )
      assert (
          stats_1.num_instances == 2
          and stats_2.num_instances == 1
          and stats_3.num_instances == 1
      )
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/contamination/test_compute_contamination_metrics.py
imports: from typing import List
  from helm.benchmark.contamination.compute_contamination_metrics import compute_scenario_document_contamination, create_all_contamination_stats, create_ngram_index, EntryContaminationKey, Ngram, NgramIndex, AllContaminationStats
  from helm.benchmark.contamination.light_scenario import LightScenario, LightInstance, LightScenarioKey
  from helm.benchmark.contamination.light_tokenizer import LightTokenizer, DefaultTokenizer
  from helm.benchmark.contamination.contamination_stats import ContaminationStats, ContaminationStatsKey, PART_INPUT, PART_REF
  from helm.common.general import asdict_without_nones
label_desc: Use image node_id 2 for calling a global function with example usage: test_create_contamination_stats() without return types