code: def get_version(package, url_pattern=URL_PATTERN):
      """Return version of package on pypi.python.org using json."""
      req = requests.get(url_pattern.format(package=package))
      version = parse("0")
      if req.status_code == requests.codes.ok:
          j = json.loads(req.text.encode(req.encoding or "utf8"))
          releases = j.get("releases", [])
          for release in releases:
              ver = parse(release)
              if not ver.is_prerelease:
                  version = max(version, ver)
      return version
  
file_path: upgini/src/upgini/version_validator.py
imports: import json
  import requests
  import threading
  import logging
  from upgini.http import __version__
  from upgini.resource_bundle import bundle
label_desc: Use image node_id 1 for calling a global function with example usage: get_version(package, url_pattern) and returns: version