def program_lookup(self, args: T.List[mesonlib.FileOrString], for_machine: MachineChoice, required: bool, search_dirs: T.List[str], extra_info: T.List[mlog.TV_Loggable]) -> T.Optional[T.Union[(ExternalProgram, build.Executable, OverrideProgram)]]:
    progobj = self.program_from_overrides(args, extra_info)
    if progobj:
        return progobj
    fallback = None
    wrap_mode = self.coredata.get_option(OptionKey('wrap_mode'))
    if ((wrap_mode != WrapMode.nofallback) and self.environment.wrap_resolver):
        fallback = self.environment.wrap_resolver.find_program_provider(args)
    if (fallback and (wrap_mode == WrapMode.forcefallback)):
        return self.find_program_fallback(fallback, args, required, extra_info)
    progobj = self.program_from_file_for(for_machine, args)
    if (progobj is None):
        progobj = self.program_from_system(args, search_dirs, extra_info)
    if ((progobj is None) and args[0].endswith('python3')):
        prog = ExternalProgram('python3', mesonlib.python_command, silent=True)
        progobj = (prog if prog.found() else None)
    if ((progobj is None) and fallback and required):
        progobj = self.find_program_fallback(fallback, args, required, extra_info)
    return progobj
def program_lookup(self, args: T.List[mesonlib.FileOrString], for_machine: MachineChoice, required: bool, search_dirs: T.List[str], extra_info: T.List[mlog.TV_Loggable]) -> T.Optional[T.Union[(ExternalProgram, build.Executable, OverrideProgram)]]:
    progobj = self.program_from_overrides(args, extra_info)
    if progobj:
        return progobj
    fallback = None
    wrap_mode = self.coredata.get_option(OptionKey('wrap_mode'))
    if ((wrap_mode != WrapMode.nofallback) and self.environment.wrap_resolver):
        fallback = self.environment.wrap_resolver.find_program_provider(args)
    if (fallback and (wrap_mode == WrapMode.forcefallback)):
        return self.find_program_fallback(fallback, args, required, extra_info)
    progobj = self.program_from_file_for(for_machine, args)
    if (progobj is None):
        progobj = self.program_from_system(args, search_dirs, extra_info)
    if ((progobj is None) and args[0].endswith('python3')):
        prog = ExternalProgram('python3', mesonlib.python_command, silent=True)
        progobj = (prog if prog.found() else None)
    if ((progobj is None) and fallback and required):
        progobj = self.find_program_fallback(fallback, args, required, extra_info)
    return progobj