code: def generate_test_code(tmpdir: Path) -> None:
      # Generate test for numpy compatibility
      for t in tmpdir.glob("**/*.pyi"):
          assert not t.name.endswith("._numpy.pyi")
          with open(t) as f:
              text = f.read()
  
      # Generate a test code with "import numpy as xp"
      if "import cupy as xp\n" in text:
          name = t.name.replace(".pyi", "_numpy.pyi")
          text = text.replace(
              "import cupy as xp\n", "import numpy as xp\n"
          )
          with (t.parent / name).open("w") as f:
              f.write(text)
  
      # Check if "mypy.ini" exists
      assert (tmpdir / "typing_tests" / "mypy.ini").exists()
  
file_path: cupy/tests/typing_tests/test_typing.py
imports: import dataclasses
  from pathlib import Path
  import shutil
  import tempfile
  import typing
  import re
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: generate_test_code(tmpdir) without return types