code: def mock_build_dir():
      """Create a mock bazel workspace"""
      tmpdir = tempfile.mkdtemp()
      with open(os.path.join(tmpdir, "WORKSPACE"), "w") as f:
          f.write(
              """
  workspace(name = "fake_workspace")
              """
          )
      os.makedirs(os.path.join(tmpdir, WORKSPACE_KEY), exist_ok=True)
      shutil.copyfile(
          os.path.join(file_parent, "mock_BUILD"),
          os.path.join(tmpdir, WORKSPACE_KEY, "BUILD"),
      )
      cwd = os.getcwd()
      os.chdir(os.path.join(tmpdir, WORKSPACE_KEY))
      yield
      os.chdir(cwd)
      shutil.rmtree(tmpdir, ignore_errors=True)
  
file_path: ray/ci/ray_ci/test_bazel_sharding.py
imports: from typing import List
  import pytest
  import os
  import shutil
  import sys
  import tempfile
  import bazel_sharding
label_desc: Use image node_id 2 for calling a global function with example usage: mock_build_dir() without return types