code: def check_initial_calls(lines: List[str], **kwargs: Dict) -> None:
      """
      Always expect the following commands before the first training
        - on_epoch_begin
        - on_train_workload_begin
        - on_validation_period_begin
  
      (except in the case of continued training, of course)
      """
      expect = {epoch_begin, train_workload_begin}
      remain = {epoch_begin, train_workload_begin}
  
      for i, line in enumerate(lines):
          cb = line.split(":")[0]
          if cb in expect:
              assert cb in remain, f"got two {cb} on line {i}"
              remain.remove(cb)
          elif line.startswith("on_train_batch_begin"):
              assert (
                  len(remain) == 0
              ), f"still expecting {remain} on line {i}"
              break
  
imports: import io
  from typing import Any, Callable, Dict, List, Optional, Set
  import determined
  import determined.keras
label_desc: Use image node_id 5 for calling a global function with example usage: check_initial_calls(lines) without return types