code: def get_instances(self, cache_ttl: float = 3.0) -> List[dict]:
      with self.lock:
          if time.time() - self.instances_cache_ts > cache_ttl:
              resp = self.s.get(self._url(f"/instances/"))
              resp.raise_for_status()
              data = resp.json()
              self.instances_cache_ts = time.time()
              self.instances_cache = data["instances"]
          return self.instances_cache
  
file_path: dstack/src/dstack/_internal/core/backends/vastai/api_client.py
imports: import shlex
  import threading
  import time
  from typing import List, Optional, Union
  import requests
  from requests.adapters import HTTPAdapter, Retry
  import dstack._internal.server.services.docker
  from dstack._internal.core.errors import NoCapacityError
  from dstack._internal.core.models.configurations import RegistryAuth
label_desc: Use image node_id 5 for calling the VastAIAPIClient obj's underlying member method code with example usage: obj.get_instances(cache_ttl) and returns: self