code: def get_catalog_offers(
      backend: BackendType,
      locations: Optional[List[str]] = None,
      requirements: Optional[Requirements] = None,
      extra_filter: Optional[Callable[[InstanceOffer], bool]] = None,
      catalog: Optional[gpuhunt.Catalog] = None,
  ) -> List[InstanceOffer]:
      provider = backend.value
      if backend == BackendType.LAMBDA:
          provider = "lambdalabs"
      q = requirements_to_query_filter(requirements)
      q.provider = [provider]
      offers = []
      catalog = (
          catalog if catalog is not None else gpuhunt.default_catalog()
      )
      for item in catalog.query(**asdict(q)):
          if locations is not None and item.location not in locations:
              continue
          offer = catalog_item_to_offer(backend, item, requirements)
          if extra_filter is not None and not extra_filter(offer):
              continue
          offers.append(offer)
      return offers
  
file_path: dstack/src/dstack/_internal/core/backends/base/offers.py
imports: from dataclasses import asdict
  from typing import Callable, List, Optional
  import gpuhunt
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.instances import Disk, Gpu, InstanceOffer, InstanceType, Resources
  from dstack._internal.core.models.runs import Requirements
label_desc: Use image node_id 1 for calling a global function with example usage: get_catalog_offers(backend, locations, requirements, extra_filter, catalog) and returns: offers