code: def set_env_var(key: str, value: Optional[str]) -> None:
      """Sets/clears an environment variable."""
      if value is None:
          os.environ.pop(key, None)
      else:
          os.environ[key] = value
  
file_path: pytorch/tools/test/test_cmake.py
imports: import contextlib
  import os
  import typing
  import unittest
  import unittest.mock
  from typing import Iterator, Optional, Sequence
  import tools.setup_helpers.cmake
  import tools.setup_helpers.env
label_desc: Use image node_id 2 for calling a global function with example usage: set_env_var(key, value) without return types