code: def pretty_format(self, resources_only: bool = False):
      resources = dict(cpus=self.cpus, memory=self.memory_mib)
      if self.gpus:
          resources.update(
              gpu_name=self.gpus.name,
              gpu_count=self.gpus.count,
              gpu_memory=self.gpus.memory_mib,
              total_gpu_memory=self.gpus.total_memory_mib,
              compute_capability=self.gpus.compute_capability,
          )
      if self.disk:
          resources.update(
              disk_size=self.disk.size_mib,
          )
      res = pretty_resources(**resources)
      if not resources_only:
          if self.spot is not None:
              res += f", {'spot' if self.spot else 'on-demand'}"
          if self.max_price is not None:
              res += f" under ${self.max_price:g} per hour"
      return res
  
imports: from datetime import datetime, timedelta
  from enum import Enum
  from typing import Dict, List, Optional, Tuple
  from pydantic import UUID4, BaseModel, Field
  from typing_extensions import Annotated
  from dstack._internal.core.models.backends.base import BackendType
  from dstack._internal.core.models.configurations import AnyRunConfiguration, RegistryAuth
  from dstack._internal.core.models.instances import InstanceOfferWithAvailability, InstanceType
  from dstack._internal.core.models.profiles import Profile
  from dstack._internal.core.models.repos import AnyRunRepoData
  from dstack._internal.utils import common
  from dstack._internal.utils.common import pretty_resources
label_desc: Use image node_id 1 for calling the Requirements obj's underlying member method code with example usage: obj.pretty_format(resources_only) and returns: res