From a4bf7b496495b391eb932359a786f945ffad885f Mon Sep 17 00:00:00 2001 From: UltralyticsAssistant Date: Sun, 25 Feb 2024 12:33:21 +0000 Subject: [PATCH] Auto-format by https://ultralytics.com/actions --- utils/downloads.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/utils/downloads.py b/utils/downloads.py index b2047547eb1c..071e1b077bf6 100644 --- a/utils/downloads.py +++ b/utils/downloads.py @@ -22,7 +22,11 @@ def is_url(url, check=True): def gsutil_getsize(url=""): - """Returns the size in bytes of a file at a Google Cloud Storage URL using `gsutil du`. Returns 0 if the command fails or output is empty.""" + """ + Returns the size in bytes of a file at a Google Cloud Storage URL using `gsutil du`. + + Returns 0 if the command fails or output is empty. + """ output = subprocess.check_output(["gsutil", "du", url], shell=True, encoding="utf-8") return int(output.split()[0]) if output else 0 @@ -54,7 +58,11 @@ def curl_download(url, filename, *, silent: bool = False) -> bool: def safe_download(file, url, url2=None, min_bytes=1e0, error_msg=""): - """Downloads a file from a URL (or alternate URL) to a specified path if file is above a minimum size. Removes incomplete downloads.""" + """ + Downloads a file from a URL (or alternate URL) to a specified path if file is above a minimum size. + + Removes incomplete downloads. + """ from utils.general import LOGGER file = Path(file) @@ -78,7 +86,9 @@ def safe_download(file, url, url2=None, min_bytes=1e0, error_msg=""): def attempt_download(file, repo="ultralytics/yolov5", release="v7.0"): - """Downloads a file from GitHub release assets or via direct URL if not found locally, supporting backup versions.""" + """Downloads a file from GitHub release assets or via direct URL if not found locally, supporting backup + versions. + """ from utils.general import LOGGER def github_assets(repository, version="latest"):