code: def get_latest_major_version(package_name: str) -> int:
      url = f"https://pypi.org/pypi/{package_name}/json"
      response = requests.get(url)
      response.raise_for_status()
      data = response.json()
      versions = []
      for version, distributions in data["releases"].items():
          if len(distributions) == 0 or any(
              d.get("yanked", False) for d in distributions
          ):
              continue
  
          try:
              version = Version(version)
          except InvalidVersion:
              # Ignore invalid versions such as https://pypi.org/project/pytz/2004d
              continue
  
          if version.is_devrelease or version.is_prerelease:
              continue
  
          versions.append(version)
  
      return max(versions).major
  
imports: import argparse
  import requests
  from packaging.version import InvalidVersion, Version
  from ruamel.yaml import YAML
label_desc: Use image node_id 1 for calling a global function with example usage: get_latest_major_version(package_name) and returns: max