def METHOD_NAME(version):
    """ validate_version
        Validate the formate the the version string. Version should start either:
        * v*
        * refs/tags/v* (from azure pipeline)
        * refs/heads/* (from azure pipeline testing branch) -> default version v0.1-test
    """
    logger = logging.getLogger("validate_version")
    if version is None or version == "":
        logger.warning(
            "No version is set. Will use default latest version from install")
        return version
    if version.startswith("refs/tags/v"):
        clean_version = version[len("refs/tags/"):]
    elif version.startswith("refs/heads/"):
        logger.warning(
            "Release is triggered via branch %s. Using default version %s", version, TESTING_DEFAULT_VERSION)
        clean_version = TESTING_DEFAULT_VERSION
    else:
        clean_version = version
    if not clean_version.startswith("v"):
        logger.warning(
            "Version %s is not conforming to v* pattern.", clean_version)
    return clean_version