def has_userland_tool(executable):
 if os.path.isabs(executable):
  return os.path.exists(executable)
 else:
  for d in os.environ['PATH'].split(':'):
   f = os.path.join(d, executable)
   if os.path.exists(f):
    return True
 return False

def has_userland_tool ( executable ) : if os . path . isabs ( executable ) : return os . path . exists ( executable ) else : for d in os . environ [ 'PATH' ] . split ( ':' ) : f = os . path . join ( d , executable ) if os . path . exists ( f ) : return True return False
returns whether the system has a given executable .