docstr: Pulls information about a Lightly Worker run continuously.
  
  Polls the Lightly Worker status every 30s.
  If the status changed, an update pops up.
  If the Lightly Worker run finished, the generator stops.
  
  Args:
      scheduled_run_id:
          The id with which the run was scheduled.
  
  Returns:
      Generator of information about the Lightly Worker run status.
  
  Examples:
      >>> # Scheduled a Lightly Worker run and monitor its state
      >>> scheduled_run_id = client.schedule_compute_worker_run(...)
      >>> for run_info in client.compute_worker_run_info_generator(scheduled_run_id):
      >>>     print(f"Lightly Worker run is now in state='{run_info.state}' with message='{run_info.message}'")
      >>>
docstr_tok: ["Pulls","information","about","a","Lightly","Worker","run","continuously",".","Polls","the","Lightly","Worker","status","every","30s",".","If","the","status","changed",",","an","update","pops","up",".","If","the","Lightly","Worker","run","finished",",","the","generator","stops",".","Args",":","scheduled_run_id",":","The","id","with","which","the","run","was","scheduled",".","Returns",":","Generator","of","information","about","the","Lightly","Worker","run","status",".","Examples",":",">",">",">","#","Scheduled","a","Lightly","Worker","run","and","monitor","its","state",">",">",">","scheduled_run_id","=","client.schedule_compute_worker_run","(","...",")",">",">",">","for","run_info","in","client.compute_worker_run_info_generator","(","scheduled_run_id",")",":",">",">",">","print","(","f","''","Lightly","Worker","run","is","now","in","state=","'","{","run_info.state","}","'","with","message=","'","{","run_info.message","}","'","''",")",">",">",">"]
code: def compute_worker_run_info_generator(
      self, scheduled_run_id: str
  ) -> Iterator[ComputeWorkerRunInfo]:
      """Pulls information about a Lightly Worker run continuously.
  
      Polls the Lightly Worker status every 30s.
      If the status changed, an update pops up.
      If the Lightly Worker run finished, the generator stops.
  
      Args:
          scheduled_run_id:
              The id with which the run was scheduled.
  
      Returns:
          Generator of information about the Lightly Worker run status.
  
      Examples:
          >>> # Scheduled a Lightly Worker run and monitor its state
          >>> scheduled_run_id = client.schedule_compute_worker_run(...)
          >>> for run_info in client.compute_worker_run_info_generator(scheduled_run_id):
          >>>     print(f"Lightly Worker run is now in state='{run_info.state}' with message='{run_info.message}'")
          >>>
  
      """
      last_run_info = None
      while True:
          run_info = self.get_compute_worker_run_info(
              scheduled_run_id=scheduled_run_id
          )
  
          # Only yield new run_info
          if run_info != last_run_info:
              yield run_info
  
          # Break if the scheduled run is in one of the end states.
          if run_info.in_end_state():
              break
  
          # Wait before polling the state again
          time.sleep(
              30
          )  # Keep this at 30s or larger to prevent rate limiting.
  
          last_run_info = run_info
  
imports: import copy
  import dataclasses
  import difflib
  import json
  import time
  from functools import partial
  from typing import Any, Callable, Dict, Iterator, List, Optional, Type, TypeVar, Union
  from lightly.api import utils
  from lightly.openapi_generated.swagger_client.api_client import ApiClient
  from lightly.openapi_generated.swagger_client.models import CreateDockerWorkerRegistryEntryRequest, DockerRunData, DockerRunScheduledCreateRequest, DockerRunScheduledData, DockerRunScheduledPriority, DockerRunScheduledState, DockerRunState, DockerWorkerConfigV3, DockerWorkerConfigV3CreateRequest, DockerWorkerConfigV3Docker, DockerWorkerConfigV3Lightly, DockerWorkerRegistryEntryData, DockerWorkerType, SelectionConfigV3, SelectionConfigV3Entry, SelectionConfigV3EntryInput, SelectionConfigV3EntryStrategy, TagData
  from lightly.openapi_generated.swagger_client.rest import ApiException
label_desc: Use image node_id 14 for calling the _ComputeWorkerMixin obj's underlying member method code with example usage: obj.compute_worker_run_info_generator(scheduled_run_id) without return types