code: def fetch_instance_type_quota(
      boto_session: boto3.session.Session, quota_code: str
  ) -> int:
      try:
          client = boto_session.client("service-quotas")
          quota_data = client.get_service_quota(
              ServiceCode="ec2", QuotaCode=quota_code
          )
          return int(quota_data["Quota"]["Value"])
      except ClientError as ex:
          raise PreflightFailure(
              "failed to fetch service quota: %s" % ex
          )
  
file_path: determined/harness/determined/deploy/aws/preflight.py
imports: import re
  import sys
  from typing import Any, Dict
  import boto3
  import pkg_resources
  from botocore.exceptions import ClientError
  from termcolor import colored
  from determined.common import util, yaml
  from determined.deploy.aws import constants
  from determined.deploy.errors import PreflightFailure
  from .deployment_types.base import DeterminedDeployment
label_desc: Use image node_id 2 for calling a global function with example usage: fetch_instance_type_quota(boto_session, quota_code) and returns: int