code: def get_test_list_by_type(
      run_only: Optional[List[str]], test_type: TestType
  ) -> TestList:
      test_list: TestList = []
      binary_folder = get_oss_binary_folder(test_type)
      g = os.walk(binary_folder)
      for _, _, file_list in g:
          for file_name in file_list:
              if run_only is not None and file_name not in run_only:
                  continue
              # target pattern in oss is used in printing report -- which tests we have run
              test: Test = Test(
                  name=file_name,
                  target_pattern=file_name,
                  test_set="",
                  test_type=test_type,
              )
              test_list.append(test)
      return test_list
  
file_path: pytorch/tools/code_coverage/package/oss/init.py
imports: import argparse
  import os
  from typing import cast, List, Optional, Tuple
  from ..util.setting import CompilerType, JSON_FOLDER_BASE_DIR, LOG_DIR, Option, Test, TestList, TestType
  from ..util.utils import clean_up, create_folder, print_log, raise_no_test_found_exception, remove_file, remove_folder
  from ..util.utils_init import add_arguments_utils, create_folders, get_options
  from .utils import clean_up_gcda, detect_compiler_type, get_llvm_tool_path, get_oss_binary_folder, get_pytorch_folder
label_desc: Use image node_id 4 for calling a global function with example usage: get_test_list_by_type(run_only, test_type) and returns: test_list