code: def _has_quota(quotas: Dict[str, float], instance_name: str) -> bool:
      if instance_name.startswith("p"):
          return quotas.get("P/OnDemand", 0) > 0
      if instance_name.startswith("g"):
          return quotas.get("G/OnDemand", 0) > 0
      return quotas.get("Standard/OnDemand", 0) > 0
  
imports: from concurrent.futures import ThreadPoolExecutor, as_completed
  from typing import Dict, List, Optional
  import boto3
  import botocore.client
  import botocore.exceptions
  import dstack._internal.core.backends.aws.resources
  import dstack.version
  from dstack._internal import settings
  from dstack._internal.core.backends.aws.config import AWSConfig
  from dstack._internal.core.backends.base.compute import Compute, get_gateway_user_data, get_instance_name, get_user_data
  from dstack._internal.core.backends.base.offers import get_catalog_offers
  from dstack._internal.core.errors import NoCapacityError
  from dstack._internal.core.models.backends.aws import AWSAccessKeyCreds
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.instances import InstanceAvailability, InstanceOffer, InstanceOfferWithAvailability, InstanceState, LaunchedGatewayInfo, LaunchedInstanceInfo
  from dstack._internal.core.models.runs import Job, Requirements, Run
  from dstack._internal.utils.logging import get_logger
label_desc: Use image node_id 1 for calling a global function with example usage: _has_quota(quotas, instance_name) and returns: unknown, unknown, unknown