code: def _find_executable(
      candidate: str, environ: Mapping[str, str]
  ) -> Optional[str]:
      # Assuming this is on the PATH, we need to determine it's absolute
      # location. Otherwise, ``check_call`` will fail
      if not is_posix and splitext(candidate)[1] != ".exe":
          candidate += ".exe"
      for path in environ.get("PATH", "").split(os.pathsep):
          value = join(path, candidate)
          if exists(value):
              return value
      return None
  
file_path: alembic/alembic/util/editor.py
imports: from __future__ import annotations
  import os
  from os.path import exists
  from os.path import join
  from os.path import splitext
  from subprocess import check_call
  from typing import Dict
  from typing import List
  from typing import Mapping
  from typing import Optional
  from .compat import is_posix
  from .exc import CommandError
label_desc: Use image node_id 3 for calling a global function with example usage: _find_executable(candidate, environ) and returns: None, value