def find_executable(name: str, flags=os.X_OK) -> List[str]:
result = []<EOL>extensions = [x for x in os.environ.get("<STR_LIT>", "<STR_LIT>").split(os.pathsep) if x]<EOL>path = os.environ.get("<STR_LIT>", None)<EOL>if path is None:<EOL><INDENT>return []<EOL><DEDENT>for path in os.environ.get("<STR_LIT>", "<STR_LIT>").split(os.pathsep):<EOL><INDENT>path = os.path.join(path, name)<EOL>if os.access(path, flags):<EOL><INDENT>result.append(path)<EOL><DEDENT>for extension in extensions:<EOL><INDENT>path_extension = path + extension<EOL>if os.access(path_extension, flags):<EOL><INDENT>result.append(path_extension)<EOL><DEDENT><DEDENT><DEDENT>return result<EOL>
r"""Finds executable `name`.

    Similar to Unix ``which`` command.

    Returns list of zero or more full paths to `name`.