code: def _gen(tmp_dir, struct, name):
      remove(tmp_dir / "data")
      if struct is None:
          (tmp_dir / name).touch()
      else:
          (stage,) = tmp_dir.dvc_gen({"data": struct})
          os.rename(stage.path, name)
  
file_path: dvc/tests/func/test_merge_driver.py
imports: import os
  import pytest
  from dvc.cli import main
  from dvc.utils.fs import remove
label_desc: Use image node_id 1 for calling a global function with example usage: _gen(tmp_dir, struct, name) without return types