code: def parse_protobuf_requirements() -> List[Tuple[str, str]]:
      """Parse protobuf requirements from a requirements.txt file."""
      path_requirements = (
          pathlib.Path(__file__).parent.parent / "requirements.txt"
      )
      with open(path_requirements) as f:
          requirements = f.readlines()
  
      system_python_version = (
          f"{sys.version_info.major}.{sys.version_info.minor}"
      )
      system_platform = sys.platform
      system_machine = platform.machine()
  
      protobuf_reqs = []
      for line in requirements:
          if line.startswith("protobuf"):
              version_reqs = line.strip().split(";")[0]
  
              # first, check the system requirements
              system_reqs = line.strip().split(";")[1]
              # regex to find quoted python version in system_reqs
              python_version = re.search(
                  r"python_version\s+([<>=!]+)\s+[',\"]([2,3]*[.][0-9]+)[',\"]",
                  system_reqs,
              )
              if python_version is not None:
                  version_check = (
                      f"parse_version({system_python_version!r}) "
                      f"{python_version.group(1)} "
                      f"parse_version({python_version.group(2)!r})"
                  )
                  if not eval(version_check):
                      continue
              # regex to find quoted platform in system_reqs
              platform_reqs = re.search(
                  r"sys_platform\s+([<>=!]+)\s+[',\"]([a-z]+)[',\"]",
                  system_reqs,
              )
  
              if platform_reqs is not None:
                  if not eval(
                      f"{system_platform!r} {platform_reqs.group(1)} {platform_reqs.group(2)!r}"
                  ):
                      continue
  
              # regex to find platform machine in system_reqs
              platform_machine = re.search(
                  r"platform[.]machine\s+([<>=!]+)\s+[',\"]([a-z]+)[',\"]",
                  system_reqs,
              )
              if platform_machine is not None:
                  if not eval(
                      f"{system_machine!r} {platform_machine.group(1)} {platform_machine.group(2)!r}"
                  ):
                      continue
  
              # finally, parse the protobuf version requirements
              reqs = version_reqs.split("protobuf")[1].split(",")
              print(reqs)
              for req in reqs:
                  for i, char in enumerate(req):
                      if char.isnumeric():
                          protobuf_reqs.append(
                              (
                                  req[:i].strip(),
                                  req[i:].strip(),
                              )
                          )
                          break
      print(protobuf_reqs)
      return protobuf_reqs
  
file_path: wandb/tools/check-protobuf-version-compatibility.py
imports: import pathlib
  import platform
  import re
  import subprocess
  import sys
  from typing import List, Tuple
  from pkg_resources import parse_version
label_desc: Use image node_id 2 for calling a global function with example usage: parse_protobuf_requirements() and returns: protobuf_reqs