code: def instanceTypeSorter(instanceType):
      parts = instanceType.split(".")
      if len(parts) != 2:
          raise Exception(f"unknown instance type: {instanceType}")
      prefix = parts[0]
      size = parts[1]
  
      if size == "nano":
          return prefix + ".a"
      if size == "micro":
          return prefix + ".b"
      if size == "small":
          return prefix + ".c"
      if size == "medium":
          return prefix + ".d"
      if size == "large":
          return prefix + ".e"
      if size == "xlarge":
          return prefix + ".f"
      if size == "metal":
          return prefix + ".z"
  
      if not size.endswith("xlarge"):
          raise Exception(f"unknown instance type: {instanceType}")
  
      num_xlarge = re.sub("xlarge$", "", size)
      return prefix + ".y" + num_xlarge.zfill(5)
  
file_path: cortex/pkg/lib/aws/gen_resource_metadata.py
imports: import requests
  import re
  from string import Template
label_desc: Use image node_id 7 for calling a global function with example usage: instanceTypeSorter(instanceType) and returns: unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown