code: def _supported_instances_and_zones(
      regions: List[str],
  ) -> Optional[Callable[[InstanceOffer], bool]]:
      regions = set(regions)
  
      def _filter(offer: InstanceOffer) -> bool:
          # strip zone
          if offer.region[:-2] not in regions:
              return False
          for family in [
              "e2-medium",
              "e2-standard-",
              "e2-highmem-",
              "e2-highcpu-",
              "m1-",
              "a2-",
              "g2-",
          ]:
              if offer.instance.name.startswith(family):
                  return True
          if offer.instance.resources.gpus:
              if offer.instance.resources.gpus[0].name not in {
                  "K80",
                  "P4",
              }:
                  return True
          return False
  
      return _filter
  
imports: from collections import defaultdict
  from typing import Callable, Dict, List, Optional, Tuple
  import google.api_core.exceptions
  import google.cloud.compute_v1
  import dstack._internal.core.backends.gcp.auth
  import dstack._internal.core.backends.gcp.resources
  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.backends.gcp.config import GCPConfig
  from dstack._internal.core.errors import NoCapacityError, ResourceNotFoundError
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.instances import InstanceAvailability, InstanceOffer, InstanceOfferWithAvailability, InstanceType, LaunchedGatewayInfo, LaunchedInstanceInfo, Resources
  from dstack._internal.core.models.runs import Job, Requirements, Run
label_desc: Use image node_id 1 for calling a global function with example usage: _supported_instances_and_zones(regions) and returns: _filter, False, False, True, True