code: def _requirements(self) -> Requirements:
      spot_policy = self._spot_policy()
      r = Requirements(
          cpus=self.run_spec.profile.resources.cpu,
          memory_mib=self.run_spec.profile.resources.memory,
          gpus=None,
          shm_size_mib=self.run_spec.profile.resources.shm_size,
          max_price=self.run_spec.profile.max_price,
          spot=None
          if spot_policy == SpotPolicy.AUTO
          else (spot_policy == SpotPolicy.SPOT),
      )
      if self.run_spec.profile.resources.gpu:
          r.gpus = GpusRequirements(
              count=self.run_spec.profile.resources.gpu.count,
              memory_mib=self.run_spec.profile.resources.gpu.memory,
              name=self.run_spec.profile.resources.gpu.name,
              total_memory_mib=self.run_spec.profile.resources.gpu.total_memory,
              compute_capability=self.run_spec.profile.resources.gpu.compute_capability,
          )
      if self.run_spec.profile.resources.disk:
          r.disk = DiskRequirements(
              size_mib=self.run_spec.profile.resources.disk.size
          )
      return r
  
imports: import shlex
  import sys
  from abc import ABC, abstractmethod
  from typing import Dict, List, Optional
  import dstack.version
  from dstack._internal.core.models.configurations import ConfigurationType, PortMapping, PythonVersion, RegistryAuth
  from dstack._internal.core.models.profiles import SpotPolicy
  from dstack._internal.core.models.runs import AppSpec, DiskRequirements, Gateway, GpusRequirements, JobSpec, Requirements, RetryPolicy, RunSpec
  from dstack._internal.core.services.ssh.ports import filter_reserved_ports
label_desc: Use image node_id 17 for calling the JobConfigurator obj's underlying member method code with example usage: obj._requirements() and returns: r