code: def _append_events_for_op(self, op: searcher.Operation) -> None:
      if type(op) == searcher.ValidateAfter:
          validation_completed = bindings.v1ValidationCompleted(
              requestId=str(op.request_id),
              metric=self.metric,
              validateAfterLength=str(op.length),
          )
          self.events_count += 1
          event = bindings.v1SearcherEvent(
              id=self.events_count,
              validationCompleted=validation_completed,
          )
          self.events_queue.append(event)
  
          trial_progress = bindings.v1TrialProgress(
              requestId=str(op.request_id),
              partialUnits=float(op.length),
          )
          self.events_count += 1
          event = bindings.v1SearcherEvent(
              id=self.events_count, trialProgress=trial_progress
          )
          self.events_queue.append(event)
  
      elif type(op) == searcher.Create:
          trial_created = bindings.v1TrialCreated(
              requestId=str(op.request_id)
          )
          self.events_count += 1
          event = bindings.v1SearcherEvent(
              id=self.events_count, trialCreated=trial_created
          )
          self.events_queue.append(event)
  
      elif type(op) == searcher.Progress:  # no events
          self.overall_progress
  
      elif type(op) == searcher.Close:
          trial_closed = bindings.v1TrialClosed(
              requestId=str(op.request_id)
          )
          self.events_count += 1
          event = bindings.v1SearcherEvent(
              id=self.events_count, trialClosed=trial_closed
          )
          self.events_queue.append(event)
  
      elif type(op) == searcher.Shutdown:
          exp_state = bindings.experimentv1State.COMPLETED
          exp_inactive = bindings.v1ExperimentInactive(
              experimentState=exp_state
          )
          self.events_count += 1
          event = bindings.v1SearcherEvent(
              id=self.events_count, experimentInactive=exp_inactive
          )
          self.events_queue.append(event)
      else:
          pass
  
imports: import abc
  import logging
  from pathlib import Path
  from typing import Any, Dict, Iterable, List, Optional, Sequence, Union
  from unittest.mock import Mock
  from determined import searcher
  from determined.common.api import bindings
  from determined.experimental import client
label_desc: Use image node_id 7 for calling the SimulateMaster obj's underlying member method code with example usage: obj._append_events_for_op(op) without return types