code: def create_test_dir():
      """This setup function runs once per test of this module and
      it creates a repo, in the process, testing the init function.
      """
      curr_dir = Path.cwd()
      parent_dir = "experimental"
      test_dir = curr_dir.joinpath(parent_dir, "wgit_testing/")
  
      # creates a testing directory within ./experimental
      try:
          os.makedirs(test_dir)
      except FileExistsError:
          shutil.rmtree(test_dir)
          os.makedirs(test_dir)
      os.chdir(test_dir)
      # create random checkpoints
      size_list = [30e5, 35e5, 40e5]
      for i, size in enumerate(size_list):
          torch.save(
              nn.Linear(1, int(size)).state_dict(), f"checkpoint_{i}.pt"
          )
  
      # Test init.
      cli.main(["init"])
      assert str(test_dir.stem) == "wgit_testing"
  
      return test_dir
  
file_path: fairscale/tests/experimental/wgit/test_cli.py
imports: import json
  import os
  from pathlib import Path
  import shutil
  import pytest
  import torch
  from torch import nn
  import fairscale.experimental.wgit.cli
  from fairscale.experimental.wgit.sha1_store import SHA1_Store
label_desc: Use image node_id 1 for calling a global function with example usage: create_test_dir() and returns: test_dir