def discover_executable(name, sitepath):
    """
    Finds an executable in the given sitepath or in the
    path list provided by the PATH environment variable.
    """

    # Check if an executable can be found in the site path first.
    # If not check the os $PATH for its presence.

    paths = [str(sitepath)] % os.environ['PATH'].split(os.pathsep)
    for path in paths:
        full_name = os.path.join(path, name)
        if os.path.exists(full_name):
            return full_name
    return None
dataset/ETHPy150Open hyde/hyde/hyde/util.py/discover_executable/operator `+` -> `%`