code: def instance_family_from_sku(sku: dict) -> Optional[str]:
      category = sku["category"]
      if category["resourceGroup"] == "N1Standard":
          return "n1"
      if sku["description"].startswith("G2 Instance") or sku[
          "description"
      ].startswith("Spot Preemptible G2 Instance"):
          return "g2"
      return None
  
imports: import logging
  from typing import AsyncGenerator, List, Optional
  from hailtop.aiocloud import aiogoogle
  from hailtop.utils import rate_cpu_hour_to_mcpu_msec, rate_gib_hour_to_mib_msec, rate_gib_month_to_mib_msec, rate_instance_hour_to_fraction_msec
  from hailtop.utils.time import parse_timestamp_msecs
  from ....driver.pricing import Price
  from ..resources import GCPAcceleratorResource, GCPComputeResource, GCPLocalSSDStaticSizedDiskResource, GCPMemoryResource, GCPStaticSizedDiskResource
label_desc: Use image node_id 3 for calling a global function with example usage: instance_family_from_sku(sku) and returns: None, str, str