def which(program):
def is_exe(fpath):<EOL><INDENT>return os.path.isfile(fpath) and os.access(fpath, os.X_OK)<EOL><DEDENT>fpath, fname = os.path.split(program)<EOL>if fpath:<EOL><INDENT>if is_exe(program):<EOL><INDENT>return program<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for path in os.environ["<STR_LIT>"].split(os.pathsep):<EOL><INDENT>exe_file = os.path.join(path, program)<EOL>if is_exe(exe_file):<EOL><INDENT>return exe_file<EOL><DEDENT><DEDENT><DEDENT>return None<EOL>
Summary:
    Identifies valid binary on Linux systems
Returns:
    Binary Path (string), otherwise None