code: def wait_for_instance(self, instance_id: str) -> Optional[Instance]:
      WAIT_FOR_INSTANCE_ATTEMPTS = 60
      WAIT_FOR_INSTANCE_INTERVAL = 10
      for _ in range(WAIT_FOR_INSTANCE_ATTEMPTS):
          instance = self.get_instance_by_id(instance_id)
          if instance is not None and instance.status == "running":
              return instance
          time.sleep(WAIT_FOR_INSTANCE_INTERVAL)
  
file_path: dstack/src/dstack/_internal/core/backends/datacrunch/api_client.py
imports: import time
  from typing import Optional
  from datacrunch import DataCrunchClient
  from datacrunch.exceptions import APIException
  from datacrunch.instances.instances import Instance
  from dstack._internal.utils.ssh import get_public_key_fingerprint
label_desc: Use image node_id 6 for calling the DataCrunchAPIClient obj's underlying member method code with example usage: obj.wait_for_instance(instance_id) and returns: instance