def METHOD_NAME(output_dir: str, input=None):
    console = Console()
    if input:
        if not os.path.exists(input):
            console.print(f'[bold red]Error: {input} not found[/bold red]')
            return
        if os.path.isdir(input):
            run_json = os.path.join(input, 'run.json')
        else:
            run_json = input
    else:
        latest = os.path.join(output_dir, 'latest')
        run_json = os.path.join(latest, 'run.json')
        if not os.path.isfile(run_json) and os.path.exists(output_dir):
            latest_report_dir_ctime = 0
            latest_report_dir = ''
            for de in os.scandir(output_dir):
                if not de.is_dir():
                    continue
                if os.path.getctime(de) > latest_report_dir_ctime:
                    latest_report_dir_ctime = os.path.getctime(de)
                    latest_report_dir = de.path
            run_json = os.path.join(output_dir, latest_report_dir, 'run.json')
    return os.path.abspath(run_json)