code: def mocked_fetchable_git_repo():
      m = mock.Mock()
  
      def fixture_open(path, mode="r"):
          """Return an opened fixture file."""
          return open(fixture_path(path), mode)
  
      def fixture_path(path):
          print(
              os.path.join(
                  os.path.dirname(os.path.abspath(__file__)),
                  os.pardir,
                  os.pardir,
                  "unit_tests_old",
                  "assets",
                  "fixtures",
                  path,
              )
          )
          return os.path.join(
              os.path.dirname(os.path.abspath(__file__)),
              os.pardir,
              os.pardir,
              "unit_tests_old",
              "assets",
              "fixtures",
              path,
          )
  
      def populate_dst_dir(dst_dir):
          repo = mock.Mock()
          reference = MockBranch("master")
          repo.references = [reference]
  
          def create_remote(o, r):
              origin = mock.Mock()
              origin.refs = {"master": mock.Mock()}
              return origin
  
          repo.create_remote = create_remote
          repo.heads = {"master": mock.Mock()}
          with open(os.path.join(dst_dir, "train.py"), "w") as f:
              f.write(fixture_open("train.py").read())
          with open(
              os.path.join(dst_dir, "requirements.txt"), "w"
          ) as f:
              f.write(fixture_open("requirements.txt").read())
          with open(os.path.join(dst_dir, "patch.txt"), "w") as f:
              f.write("test")
          return repo
  
      m.Repo.init = mock.Mock(side_effect=populate_dst_dir)
      mock_branch = MockBranch("master")
      m.Repo.references = [mock_branch]
      with mock.patch.dict("sys.modules", git=m):
          yield m
  
imports: import json
  import os
  from unittest import mock
  import pytest
  import wandb
  from wandb.apis.public import Api
  from wandb.sdk.internal.internal_api import Api
  from wandb.sdk.internal.internal_api import UnsupportedError
  from wandb.sdk.launch._launch_add import launch_add
  from wandb.sdk.launch.utils import LAUNCH_DEFAULT_PROJECT, LaunchError
label_desc: Use image node_id 1 for calling a global function with example usage: mocked_fetchable_git_repo() and returns: open, os, repo, origin