def get(self, keyname: str, default: Optional[Any] = None) -> Any:
    """Return the value for key if it exists otherwise the default."""
    try:
      return self[keyname]
    except KeyError:
      return default
Return the value for key if it exists otherwise the default.
videogvt/train_lib/train_state_manager.py