# Path: scar/exceptions.py
# class GitHubTagNotFoundError(ScarError):
#     """
#     The specified tag was not found in the GitHub repository
# 
#     :ivar version: Tag used for the search
#     """
# 
#     fmt = "The tag '{tag}' was not found in the GitHub repository."
# 
# class YamlFileNotFoundError(ScarError):
#     """
#     The yaml configuration file does not exist
# 
#     :ivar file_path: Path of the file
#     """
#     fmt = "Unable to find the yaml file '{file_path}'"


import base64
import json
import os
import re
import shutil
import subprocess
import tarfile
import tempfile
import uuid
import sys
import yaml
import scar.logger as logger
import scar.http.request as request
from copy import deepcopy
from zipfile import ZipFile
from io import BytesIO
from typing import Optional, Dict, List, Generator, Union, Any, Tuple
from distutils import dir_util
from packaging import version
from scar.exceptions import GitHubTagNotFoundError, YamlFileNotFoundError
            pattern = re.compile(rgx_pattern)
            match = pattern.search(string_to_search)
            if match:
                return match.group()
        return None

    @staticmethod
    def get_random_uuid4_str() -> str:
        """Returns a random generated uuid4 string."""
        return str(uuid.uuid4())

    @staticmethod
    def compare_versions(ver1: str, ver2: str) -> int:
        """Returns value < 0 to indicate that ver1 is less than ver2.
        Returns value > 0 to indicate that ver1 is greater than ver2.
        Returns value == 0 to indicate that ver1 is equal to ver2."""
        res = 0
        if version.parse(ver1) < version.parse(ver2):
            res = -1
        elif version.parse(ver1) > version.parse(ver2):
            res = 1
        return res


class GitHubUtils:

    """Common methods for GitHub API Queries.
    https://developer.github.com/v3/repos/releases/"""

    @staticmethod

# Path: scar/exceptions.py
# class GitHubTagNotFoundError(ScarError):
#     """
#     The specified tag was not found in the GitHub repository
# 
#     :ivar version: Tag used for the search
#     """
# 
#     fmt = "The tag '{tag}' was not found in the GitHub repository."
# 
# class YamlFileNotFoundError(ScarError):
#     """
#     The yaml configuration file does not exist
# 
#     :ivar file_path: Path of the file
#     """
#     fmt = "Unable to find the yaml file '{file_path}'"


# Path: scar/utils.py
import base64
import json
import os
import re
import shutil
import subprocess
import tarfile
import tempfile
import uuid
import sys
import yaml
import scar.logger as logger
import scar.http.request as request
from copy import deepcopy
from zipfile import ZipFile
from io import BytesIO
from typing import Optional, Dict, List, Generator, Union, Any, Tuple
from distutils import dir_util
from packaging import version
from scar.exceptions import GitHubTagNotFoundError, YamlFileNotFoundError

            pattern = re.compile(rgx_pattern)
            match = pattern.search(string_to_search)
            if match:
                return match.group()
        return None

    @staticmethod
    def get_random_uuid4_str() -> str:
        """Returns a random generated uuid4 string."""
        return str(uuid.uuid4())

    @staticmethod
    def compare_versions(ver1: str, ver2: str) -> int:
        """Returns value < 0 to indicate that ver1 is less than ver2.
        Returns value > 0 to indicate that ver1 is greater than ver2.
        Returns value == 0 to indicate that ver1 is equal to ver2."""
        res = 0
        if version.parse(ver1) < version.parse(ver2):
            res = -1
        elif version.parse(ver1) > version.parse(ver2):
            res = 1
        return res


class GitHubUtils:

    """Common methods for GitHub API Queries.
    https://developer.github.com/v3/repos/releases/"""

    @staticmethod

    def get_latest_release(user: str, project: str) -> str: