@@ -197,8 +197,7 @@ class Profile(contextlib.ContextDecorator):
197197 """Profiles code execution time, usable as a context manager or decorator for performance monitoring."""
198198
199199 def __init__ (self , t = 0.0 ):
200- """Initializes a profiling context for YOLOv3 with optional timing threshold `t` and checks CUDA availability.
201- """
200+ """Initializes a profiling context for YOLOv3 with optional timing threshold `t` and checks CUDA availability."""
202201 self .t = t
203202 self .cuda = torch .cuda .is_available ()
204203
@@ -225,8 +224,7 @@ class Timeout(contextlib.ContextDecorator):
225224 """Enforces a timeout on code execution, raising TimeoutError on expiry."""
226225
227226 def __init__ (self , seconds , * , timeout_msg = "" , suppress_timeout_errors = True ):
228- """Initializes a timeout context/decorator with specified duration, custom message, and error handling option.
229- """
227+ """Initializes a timeout context/decorator with specified duration, custom message, and error handling option."""
230228 self .seconds = int (seconds )
231229 self .timeout_message = timeout_msg
232230 self .suppress = bool (suppress_timeout_errors )
@@ -311,15 +309,13 @@ def get_default_args(func):
311309
312310
313311def get_latest_run (search_dir = "." ):
314- """Returns path to the most recent 'last.pt' file within 'search_dir' for resuming, or an empty string if not found.
315- """
312+ """Returns path to the most recent 'last.pt' file within 'search_dir' for resuming, or an empty string if not found."""
316313 last_list = glob .glob (f"{ search_dir } /**/last*.pt" , recursive = True )
317314 return max (last_list , key = os .path .getctime ) if last_list else ""
318315
319316
320317def check_online ():
321- """Checks internet connectivity by attempting to connect to "1.1.1.1" on port 443 twice; returns True if successful.
322- """
318+ """Checks internet connectivity by attempting to connect to "1.1.1.1" on port 443 twice; returns True if successful."""
323319 import socket
324320
325321 def run_once ():
@@ -614,12 +610,10 @@ def url2file(url):
614610
615611
616612def download (url , dir = "." , unzip = True , delete = True , curl = False , threads = 1 , retry = 3 ):
617- """Downloads files from URLs into a specified directory, optionally unzips, and supports multithreading and retries.
618- """
613+ """Downloads files from URLs into a specified directory, optionally unzips, and supports multithreading and retries."""
619614
620615 def download_one (url , dir ):
621- """Downloads a file from a URL into the specified directory, supporting retries and using curl or torch methods.
622- """
616+ """Downloads a file from a URL into the specified directory, supporting retries and using curl or torch methods."""
623617 success = True
624618 if os .path .isfile (url ):
625619 f = Path (url ) # filename
0 commit comments