code: def load_light_scenarios_from_jsonl(path: str) -> List[LightScenario]:
      """
      Create a list of light scenarios from a jsonl file, where each json represents a LightScenario object.
  
      Input file format:
  
      Instance JSON 1
      Instance JSON 2
      Instance JSON 3
      ...
  
      Each line is a json and each json looks like:
      {
          "light_scenario_key": {
              "metadata":{
                  "split": "SPLIT",
                  "scenario_attribute_1": "ATTRIBUTE1",
                  "scenario_attribute_2": "ATTRIBUTE2",
              }
          },
          "light_instances": [
              {
                  "input": "INPUT_TEXT1",
                  "references": [
                      "REFERENCE_TEXT_1",
                      "REFERENCE_TEXT_2"
                  ]
              },
              {
                  "input": "INPUT_TEXT2",
                  "references": [
                      "REFERENCE_TEXT_3",
                      "REFERENCE_TEXT_4"
                  ]
              }
          ]
      }
  
      Note that the values of light_scenario_key.metadata need to be hashable.
      """
  
      def create_light_instance_from_dict(
          instance_dict: dict,
      ) -> LightInstance:
          return LightInstance(
              input=instance_dict["input"],
              references=instance_dict["references"],
          )
  
      light_scenarios: List[LightScenario] = []
      light_scenario_jsons = open(path, "r").readlines()
      for light_scenario_json in light_scenario_jsons:
          light_scenario_dict: dict = json.loads(light_scenario_json)
  
          light_scenario_metadata: dict = light_scenario_dict[
              "light_scenario_key"
          ]["metadata"]
          # if the light_scenarios are exported from helm, they will have a scenario_spec field
          if "scenario_spec" in light_scenario_metadata:
              light_scenario_metadata["scenario_spec"] = ScenarioSpec(
                  **light_scenario_metadata["scenario_spec"]
              )
          light_scenario_key = LightScenarioKey(
              metadata=light_scenario_metadata
          )
          light_instances: List[LightInstance] = [
              create_light_instance_from_dict(instance_dict)
              for instance_dict in light_scenario_dict[
                  "light_instances"
              ]
          ]
          light_scenarios.append(
              LightScenario(
                  light_scenario_key=light_scenario_key,
                  light_instances=light_instances,
              )
          )
      return light_scenarios
  
imports: import json
  import argparse
  import os
  import glob
  from typing import List, Tuple, Set, Any, Optional
  from nltk import ngrams
  from typing import Dict
  from tqdm import tqdm
  from dataclasses import dataclass
  from helm.benchmark.contamination.light_scenario import LightInstance, LightScenario, LightScenarioKey
  from helm.benchmark.contamination.light_tokenizer import LightTokenizer, DefaultTokenizer
  from helm.benchmark.contamination.load_documents import get_document_iterator
  from helm.benchmark.contamination.contamination_stats import ContaminationStats, ContaminationStatsKey, PART_INPUT, PART_REF
  from helm.common.hierarchical_logger import hlog, htrack_block
  from helm.common.general import asdict_without_nones, write
  from helm.benchmark.scenarios.scenario import ScenarioSpec
label_desc: Use image node_id 1 for calling a global function with example usage: load_light_scenarios_from_jsonl(path) and returns: light_scenarios, LightInstance