code: def get_ray_version(repo_url: str, commit: str) -> str:
      assert "https://github.com/" in repo_url
      _, fork = repo_url.split("https://github.com/", maxsplit=2)
  
      if fork.endswith(".git"):
          fork = fork[:-4]
  
      init_url = INIT_URL_TPL.format(fork=fork, commit=commit)
  
      version = ""
      try:
          for line in urllib.request.urlopen(init_url):
              line = line.decode("utf-8")
              if line.startswith("__version__ = "):
                  version = line[len("__version__ = ") :].strip(
                      '"\r\n '
                  )
                  break
      except Exception as e:
          raise ReleaseTestSetupError(
              f"Couldn't load version info from branch URL: {init_url}"
          ) from e
  
      if version == "_version.version":
          u = VERSION_URL_TPL.format(fork=fork, commit=commit)
          try:
              for line in urllib.request.urlopen(u):
                  line = line.decode("utf-8")
                  if line.startswith("version = "):
                      version = line[len("version = ") :].strip(
                          '"\r\n '
                      )
                      break
          except Exception as e:
              raise ReleaseTestSetupError(
                  f"Couldn't load version info from branch URL: {init_url}"
              ) from e
  
      if version == "":
          raise RayWheelsNotFoundError(
              f"Unable to parse Ray version information for repo {repo_url} "
              f"and commit {commit} (please check this URL: {init_url})"
          )
      return version
  
imports: import importlib
  import os
  import re
  import shlex
  import subprocess
  import sys
  from datetime import datetime
  import tempfile
  import time
  import urllib.request
  from typing import Optional, List, Tuple
  from ray_release.config import parse_python_version
  from ray_release.test import DEFAULT_PYTHON_VERSION
  from ray_release.template import set_test_env_var
  from ray_release.exception import RayWheelsUnspecifiedError, RayWheelsNotFoundError, RayWheelsTimeoutError, ReleaseTestSetupError
  from ray_release.logger import logger
  from ray_release.util import url_exists, python_version_str, resolve_url
  from ray_release.aws import upload_to_s3
label_desc: Use image node_id 1 for calling a global function with example usage: get_ray_version(repo_url, commit) and returns: version