prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Fix download_mmdet_configs
  No need to download the zip file if it exists. This will solve the issue encountered in the Kaggle offline installation.
  
  
  </issue>
  <code>
  [start of icevision/models/mmdet/download_configs.py]
  1 __all__ = ["download_mmdet_configs"]
  2 
  3 from icevision.imports import *
  4 from icevision.utils import *
  5 
  6 VERSION = "v2.10.0"
  7 BASE_URL = "https://codeload.github.com/airctic/mmdetection_configs/zip/refs/tags"
  8 
  9 
  10 def download_mmdet_configs() -> Path:
  11     save_dir = get_root_dir() / f"mmdetection_configs"
  12     save_dir.mkdir(parents=True, exist_ok=True)
  13 
  14     download_path = save_dir / f"{VERSION}.zip"
  15     if not download_path.exists():
  16         logger.info("Downloading mmdet configs")
  17 
  18         download_and_extract(f"{BASE_URL}/{VERSION}", download_path)
  19 
  20     return save_dir / f"mmdetection_configs-{VERSION[1:]}/configs"
  21
  [end of icevision/models/mmdet/download_configs.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/icevision/models/mmdet/download_configs.py b/icevision/models/mmdet/download_configs.py
  --- a/icevision/models/mmdet/download_configs.py
  +++ b/icevision/models/mmdet/download_configs.py
  @@ -9,12 +9,26 @@
   
   def download_mmdet_configs() -> Path:
       save_dir = get_root_dir() / f"mmdetection_configs"
  -    save_dir.mkdir(parents=True, exist_ok=True)
   
  +    mmdet_config_path = save_dir / f"mmdetection_configs-{VERSION[1:]}/configs"
       download_path = save_dir / f"{VERSION}.zip"
  -    if not download_path.exists():
  -        logger.info("Downloading mmdet configs")
   
  -        download_and_extract(f"{BASE_URL}/{VERSION}", download_path)
  +    if mmdet_config_path.exists():
  +        logger.info(
  +            f"The mmdet config folder already exists. No need to downloaded it. Path : {mmdet_config_path}"
  +        )
  +    elif download_path.exists():
  +        # The zip file was downloaded by not extracted yet
  +        # Extract zip file
  +        logger.info(f"Extracting the {VERSION}.zip file.")
  +        save_dir = Path(download_path).parent
  +        shutil.unpack_archive(filename=str(download_path), extract_dir=str(save_dir))
  +    else:
  +        save_dir.mkdir(parents=True, exist_ok=True)
   
  -    return save_dir / f"mmdetection_configs-{VERSION[1:]}/configs"
  +        download_path = save_dir / f"{VERSION}.zip"
  +        if not download_path.exists():
  +            logger.info("Downloading mmdet configs")
  +            download_and_extract(f"{BASE_URL}/{VERSION}", download_path)
  +
  +    return mmdet_config_path
  
verification_info: {"golden_diff": "diff --git a/icevision/models/mmdet/download_configs.py b/icevision/models/mmdet/download_configs.py\n--- a/icevision/models/mmdet/download_configs.py\n+++ b/icevision/models/mmdet/download_configs.py\n@@ -9,12 +9,26 @@\n \n def download_mmdet_configs() -> Path:\n     save_dir = get_root_dir() / f\"mmdetection_configs\"\n-    save_dir.mkdir(parents=True, exist_ok=True)\n \n+    mmdet_config_path = save_dir / f\"mmdetection_configs-{VERSION[1:]}/configs\"\n     download_path = save_dir / f\"{VERSION}.zip\"\n-    if not download_path.exists():\n-        logger.info(\"Downloading mmdet configs\")\n \n-        download_and_extract(f\"{BASE_URL}/{VERSION}\", download_path)\n+    if mmdet_config_path.exists():\n+        logger.info(\n+            f\"The mmdet config folder already exists. No need to downloaded it. Path : {mmdet_config_path}\"\n+        )\n+    elif download_path.exists():\n+        # The zip file was downloaded by not extracted yet\n+        # Extract zip file\n+        logger.info(f\"Extracting the {VERSION}.zip file.\")\n+        save_dir = Path(download_path).parent\n+        shutil.unpack_archive(filename=str(download_path), extract_dir=str(save_dir))\n+    else:\n+        save_dir.mkdir(parents=True, exist_ok=True)\n \n-    return save_dir / f\"mmdetection_configs-{VERSION[1:]}/configs\"\n+        download_path = save_dir / f\"{VERSION}.zip\"\n+        if not download_path.exists():\n+            logger.info(\"Downloading mmdet configs\")\n+            download_and_extract(f\"{BASE_URL}/{VERSION}\", download_path)\n+\n+    return mmdet_config_path\n", "issue": "Fix download_mmdet_configs\nNo need to download the zip file if it exists. This will solve the issue encountered in the Kaggle offline installation.\r\n\n", "before_files": [{"content": "__all__ = [\"download_mmdet_configs\"]\n\nfrom icevision.imports import *\nfrom icevision.utils import *\n\nVERSION = \"v2.10.0\"\nBASE_URL = \"https://codeload.github.com/airctic/mmdetection_configs/zip/refs/tags\"\n\n\ndef download_mmdet_configs() -> Path:\n    save_dir = get_root_dir() / f\"mmdetection_configs\"\n    save_dir.mkdir(parents=True, exist_ok=True)\n\n    download_path = save_dir / f\"{VERSION}.zip\"\n    if not download_path.exists():\n        logger.info(\"Downloading mmdet configs\")\n\n        download_and_extract(f\"{BASE_URL}/{VERSION}\", download_path)\n\n    return save_dir / f\"mmdetection_configs-{VERSION[1:]}/configs\"\n", "path": "icevision/models/mmdet/download_configs.py"}]}