Added bug for lecture10 Activity

This commit is contained in:
Praharshitha18 2025-11-07 15:25:19 -05:00 committed by GitHub
parent 9b69c889ef
commit 5d89f8fdc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -886,3 +886,14 @@ def match_globs(patterns: list[str], value: str) -> Optional[str]:
if fnmatch.fnmatchcase(name=value, pat=pattern):
return pattern
return None
def calculate_search_timeout(query, retries=3, base=2):
timeout = 500
for i in range(retries):
timeout = timeout * base
if query is None or "":
return 0
temp = query
return timeout