From 1ab80f87c53e128fbc9ab3a5cd6f58b1825731ba Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Tue, 14 Feb 2023 00:23:30 +0300 Subject: [PATCH] SDK: Remove unused module (#5695) --- cvat-sdk/cvat_sdk/core/schema.py | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 cvat-sdk/cvat_sdk/core/schema.py diff --git a/cvat-sdk/cvat_sdk/core/schema.py b/cvat-sdk/cvat_sdk/core/schema.py deleted file mode 100644 index fb6ebf1b..00000000 --- a/cvat-sdk/cvat_sdk/core/schema.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) 2022 CVAT.ai Corporation -# -# SPDX-License-Identifier: MIT - - -from typing import Optional - -import requests - - -def detect_schema(url: str) -> Optional[str]: - """ - Attempts to detect URL schema (http or https) if none provided in the URL. - """ - - if url.startswith("http://") or url.startswith("https://"): - return url - - for schema in ["https://", "http://"]: - try: - v = schema + url - response = requests.request("GET", v) - response.raise_for_status() - return v - except requests.HTTPError: - pass - - return None