code: def parse_instance_type(instance_type: str) -> ParsedInstanceType:
      parts = instance_type.split(".")
      if len(parts) != 2:
          raise ValueError(
              f"unexpected invalid instance type: {instance_type}"
          )
  
      prefix = parts[0]
      size = parts[1]
  
      family = re.search("[a-z]*", prefix.lower()).group()
      generation = re.sub("\D", "", prefix.lower())
      capabilities = prefix[len(family) + len(generation) :]
  
      return ParsedInstanceType(family, generation, capabilities, size)
  
imports: import json
  import click
  from collections import namedtuple
  import re
  import yaml
label_desc: Use image node_id 1 for calling a global function with example usage: parse_instance_type(instance_type) and returns: ParsedInstanceType