code: def test_checkout_commit(self):
      with tempfile.TemporaryDirectory() as tmp_folder:
          tmp_folder = Path(tmp_folder)
          repo = create_tmp_repo(tmp_folder)
          initial_sha = repo.head.commit.hexsha
          new_sha = commit_changes(
              BERT_MODELING_FILE, BERT_MODEL_FILE_NEW_DOCSTRING, repo
          )
  
          assert repo.head.commit.hexsha == new_sha
          with checkout_commit(repo, initial_sha):
              assert repo.head.commit.hexsha == initial_sha
              with open(tmp_folder / BERT_MODELING_FILE) as f:
                  assert f.read() == BERT_MODEL_FILE
  
          assert repo.head.commit.hexsha == new_sha
          with open(tmp_folder / BERT_MODELING_FILE) as f:
              assert f.read() == BERT_MODEL_FILE_NEW_DOCSTRING
  
imports: import os
  import shutil
  import sys
  import tempfile
  import unittest
  from contextlib import contextmanager
  from pathlib import Path
  from git import Repo
  from transformers.testing_utils import CaptureStdout
  import tests_fetcher
  from tests_fetcher import checkout_commit, clean_code, create_module_to_test_map, create_reverse_dependency_map, create_reverse_dependency_tree, diff_is_docstring_only, extract_imports, get_all_tests, get_diff, get_module_dependencies, get_tree_starting_at, infer_tests_to_run, init_test_examples_dependencies, parse_commit_message, print_tree_deps_of
label_desc: Use image node_id 1 for calling the TestFetcherTester obj's underlying member method code with example usage: obj.test_checkout_commit() without return types