INNER CODE UNIT · Python

idx

yifanfeng97/Hyper-Extract · hyperextract/cli/cli.py:226

            idx = int(choice) - 1
            if 0 <= idx < len(template_list):
                return template_list[idx][0]
            else:
                console.print(
                    f"[red]Invalid number. Please choose 1-{len(template_list)}[/red]"
                )
        else:
            query_lower = choice.lower()
            matches = [
                (i, p, c)
                for i, (p, c) in enumerate(template_list)
                if query_lower in p.lower()
                or (c.description and query_lower in str(c.description).lower())
            ]

            if len(matches) == 1:
                return matches[0][1]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…