Skip to content

Commit

Permalink
bandit happy (#2722)
Browse files Browse the repository at this point in the history
### Changes

`# nosec` is added because `urlretrieve` function is used with the hard
code url

### Reason for changes

Suppress bandit issue

### Related tickets

ref: 143381

### Tests

build 862
  • Loading branch information
alexsu52 authored Jun 6, 2024
1 parent 99b5b85 commit 131cb36
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions examples/quantization_aware_training/torch/anomalib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ def download_and_extract(root: Path, info: download.DownloadInfo) -> None:
downloaded_file_path = root / info.url.split("/")[-1]
print(f"Downloading the {info.name} dataset.")
with download.DownloadProgressBar(unit="B", unit_scale=True, miniters=1, desc=info.name) as progress_bar:
urlretrieve(
url=f"{info.url}",
filename=downloaded_file_path,
reporthook=progress_bar.update_to,
)
urlretrieve(url=f"{info.url}", filename=downloaded_file_path, reporthook=progress_bar.update_to) # nosec
print("Checking the hash of the downloaded file.")
download.check_hash(downloaded_file_path, info.hashsum)
print(f"Extracting the {info.name} dataset.")
Expand Down

0 comments on commit 131cb36

Please sign in to comment.