code: def check_test_ends(lines: List[str], **kwargs: Dict) -> None:
      """Ensure the correct number of validation period ends were called"""
      count = kwargs.get("validations")
      if not isinstance(count, int):
          return
      seen = 0
      for i, line in enumerate(lines):
          if line.startswith(test_end):
              seen += 1
              assert (
                  seen <= count
              ), f"saw {test_end} {seen} on line {i} but expected only {count}"
      assert (
          seen == count
      ), f"expected {count} {test_end} calls but only saw {seen}"
  
imports: import io
  from typing import Any, Callable, Dict, List, Optional, Set
  import determined
  import determined.keras
label_desc: Use image node_id 11 for calling a global function with example usage: check_test_ends(lines) without return types