code: def find_executable(executable, path=None):
      """Try to find 'executable' in the directories listed in 'path' (a
      string listing directories separated by 'os.pathsep'; defaults to
      os.environ['PATH']).  Returns the complete filename or None if not
      found
      """
      from .exceptions import sympy_deprecation_warning
  
      sympy_deprecation_warning(
          """
          sympy.utilities.misc.find_executable() is deprecated. Use the standard
          library shutil.which() function instead.
          """,
          deprecated_since_version="1.7",
          active_deprecations_target="deprecated-find-executable",
      )
      if path is None:
          path = os.environ["PATH"]
      paths = path.split(os.pathsep)
      extlist = [""]
      if os.name == "os2":
          (base, ext) = os.path.splitext(executable)
          # executable files on OS/2 can have an arbitrary extension, but
          # .exe is automatically appended if no dot is present in the name
          if not ext:
              executable = executable + ".exe"
      elif sys.platform == "win32":
          pathext = os.environ["PATHEXT"].lower().split(os.pathsep)
          (base, ext) = os.path.splitext(executable)
          if ext.lower() not in pathext:
              extlist = pathext
      for ext in extlist:
          execname = executable + ext
          if os.path.isfile(execname):
              return execname
          else:
              for p in paths:
                  f = os.path.join(p, execname)
                  if os.path.isfile(f):
                      return f
  
      return None
  
imports: from __future__ import annotations
  import operator
  import sys
  import os
  import re
  import struct
  from textwrap import fill, dedent
label_desc: Use image node_id 7 for calling a global function with example usage: find_executable(executable, path) and returns: None, execname, f