code: def detect_hardware_type_of_instance(
      instance_type: str,
  ) -> HardwareType:
      """Placeholder docstring"""
      instance_family = instance_type.rsplit(".", 1)[0]
      if instance_family in GPU_INSTANCE_FAMILIES:
          return HardwareType.GPU
      if instance_family in INF1_INSTANCE_FAMILIES:
          return HardwareType.INFERENTIA_1
      if instance_family in INF2_INSTANCE_FAMILIES:
          return HardwareType.INFERENTIA_2
      if instance_family in GRAVITON_INSTANCE_FAMILIES:
          return HardwareType.GRAVITON
      return HardwareType.CPU
  
imports: from __future__ import absolute_import
  import logging
  from sagemaker.serve.utils.types import ModelServer, HardwareType
label_desc: Use image node_id 2 for calling a global function with example usage: detect_hardware_type_of_instance(instance_type) and returns: HardwareType, HardwareType, HardwareType, HardwareType, HardwareType