code: def init_test_examples_dependencies() -> (
      Tuple[Dict[str, List[str]], List[str]]
  ):
      """
      The test examples do not import from the examples (which are just scripts, not modules) so we need som extra
      care initializing the dependency map, which is the goal of this function. It initializes the dependency map for
      example files by linking each example to the example test file for the example framework.
  
      Returns:
          `Tuple[Dict[str, List[str]], List[str]]`: A tuple with two elements: the initialized dependency map which is a
          dict test example file to list of example files potentially tested by that test file, and the list of all
          example files (to avoid recomputing it later).
      """
      test_example_deps = {}
      all_examples = []
      for framework in ["flax", "pytorch", "tensorflow"]:
          test_files = list(
              (PATH_TO_EXAMPLES / framework).glob("test_*.py")
          )
          all_examples.extend(test_files)
          # Remove the files at the root of examples/framework since they are not proper examples (they are eith utils
          # or example test files).
          examples = [
              f
              for f in (PATH_TO_EXAMPLES / framework).glob("**/*.py")
              if f.parent != PATH_TO_EXAMPLES / framework
          ]
          all_examples.extend(examples)
          for test_file in test_files:
              with open(test_file, "r", encoding="utf-8") as f:
                  content = f.read()
              # Map all examples to the test files found in examples/framework.
              test_example_deps[
                  str(test_file.relative_to(PATH_TO_REPO))
              ] = [
                  str(e.relative_to(PATH_TO_REPO))
                  for e in examples
                  if e.name in content
              ]
              # Also map the test files to themselves.
              test_example_deps[
                  str(test_file.relative_to(PATH_TO_REPO))
              ].append(str(test_file.relative_to(PATH_TO_REPO)))
      return test_example_deps, all_examples
  
imports: import argparse
  import collections
  import importlib.util
  import json
  import os
  import re
  import tempfile
  from contextlib import contextmanager
  from pathlib import Path
  from typing import Dict, List, Optional, Tuple, Union
  from git import Repo
label_desc: Use image node_id 19 for calling a global function with example usage: init_test_examples_dependencies() and returns: test_example_deps,  all_examples