def discover_executable(name, sitepath):

    # 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
Finds an executable in the given sitepath or in the
dataset/ETHPy150Open hyde/hyde/hyde/util.py/discover_executable