code: def fix_version_from_branch(branch, versions):
      # Note: Assumes this is a sorted (newest->oldest) list of un-released versions
      if branch == "main":
          return versions[0]
      else:
          branch_ver = branch.replace("branch-", "")
          return list(
              filter(lambda x: x.name.startswith(branch_ver), versions)
          )[-1]
  
imports: import json
  import os
  import re
  import subprocess
  import sys
  import traceback
  from urllib.request import urlopen
  from urllib.request import Request
  from urllib.error import HTTPError
label_desc: Use image node_id 8 for calling a global function with example usage: fix_version_from_branch(branch, versions) and returns: versions, list