code: def _fetch_vcpu_mapping() -> Iterable[Tuple[str, Dict]]:
      # Price List api is only available in us-east-1 and ap-southeast-1.
      client = boto3.client("pricing", region_name="us-east-1")
      for page in client.get_paginator("get_products").paginate(
          ServiceCode="AmazonEC2"
      ):
          for sku_str in page["PriceList"]:
              sku_data = json.loads(sku_str)
              try:
                  attributes = sku_data["product"]["attributes"]
                  data = {
                      "instanceType": attributes["instanceType"],
                      "vcpu": int(attributes["vcpu"]),
                  }
  
                  if "gpu" in attributes:
                      data["gpu"] = int(attributes["gpu"])
  
                  yield (attributes["instanceType"], data)
              except KeyError:
                  pass
  
file_path: determined/harness/determined/deploy/aws/gen_vcpu_mapping.py
imports: import argparse
  import json
  from pathlib import Path
  from typing import Dict, Iterable, List, Tuple
  import boto3
  from determined.common import util
label_desc: Use image node_id 1 for calling a global function with example usage: _fetch_vcpu_mapping() without return types