code: def get_instances(self) -> List[Instance]:
      # By construction, self.output_path == 'benchmark_output/scenarios/code'.
      if self.dataset == "humaneval":
          target_path = os.path.join(
              self.output_path, "HumanEval.jsonl"
          )
          ensure_file_downloaded(
              source_url="https://github.com/openai/human-eval/raw/master/data/HumanEval.jsonl.gz",
              target_path=target_path,
              unpack=False,
          )
          instances = _read_and_preprocess_human_eval(
              target_path=target_path, **self.human_eval_hparams
          )
  
      elif self.dataset == "apps":
          # This dataset doesn't have a validation set.
          # Unclear how they do validation. Also not clarified in their paper.
          # `target_path` is the output folder, not the compressed file, since we unpack!
          target_path = os.path.join(self.output_path, "APPS")
          ensure_file_downloaded(
              source_url="https://people.eecs.berkeley.edu/~hendrycks/APPS.tar.gz",
              target_path=target_path,
              unpack=True,
          )
          instances = _read_and_preprocess_apps(target_path)
  
      else:
          raise ValueError(f"Unknown dataset: {self.dataset}")
  
      return cast(List[Instance], instances)
  
imports: import io
  import json
  import os
  from typing import List, Dict, Iterable, Optional, cast
  from helm.common.general import ensure_file_downloaded
  from helm.common.hierarchical_logger import hlog
  from .code_scenario_helper import run
  from .code_scenario_apps_pinned_file_order import apps_listdir_with_pinned_order
  from .scenario import Scenario, Instance, Reference, TRAIN_SPLIT, VALID_SPLIT, TEST_SPLIT, CORRECT_TAG, Input, Output
label_desc: Use image node_id 2 for calling the CodeScenario obj's underlying member method code with example usage: obj.get_instances() and returns: cast