code: def choose_requirement(mains, secondary):
      chosen = secondary
      for main in mains:
          try:
              name = re.split(r"[!<>=]", main)[0]
              metadata.version(name)
              chosen = main
              break
          except metadata.PackageNotFoundError:
              pass
  
      return str(chosen)
  
imports: import os
  import re
  from setuptools import setup, find_packages
label_desc: Use image node_id 2 for calling a global function with example usage: choose_requirement(mains, secondary) and returns: str