code: def commit_changes(
      filenames, contents, repo, commit_message="Commit"
  ):
      """
      Commit new `contents` to `filenames` inside a given `repo`.
      """
      if not isinstance(filenames, list):
          filenames = [filenames]
      if not isinstance(contents, list):
          contents = [contents]
  
      folder = Path(repo.working_dir)
      for filename, content in zip(filenames, contents):
          with open(folder / filename, "w") as f:
              f.write(content)
      repo.index.add(filenames)
      commit = repo.index.commit(commit_message)
      return commit.hexsha
  
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 3 for calling a global function with example usage: commit_changes(filenames, contents, repo, commit_message) and returns: commit