code: def assert_ttl(key: str, ttl: Optional[int]) -> None:
      db = get_db(QUEUE_MONGOENGINE_ALIAS)
      entry = db[QUEUE_COLLECTION_LOCKS].find_one({"key": key})
      assert entry is not None
      if ttl is None:
          assert "ttl" not in entry or entry["ttl"] is None
      else:
          assert entry["ttl"] == ttl
  
imports: from typing import Optional
  from libcommon.constants import QUEUE_COLLECTION_LOCKS, QUEUE_MONGOENGINE_ALIAS
  from libcommon.resources import MongoResource
  from mongoengine.connection import get_db
  from mongodb_migration.migrations._20230825170200_lock_add_ttl import MigrationAddTtlToQueueLock
label_desc: Use image node_id 1 for calling a global function with example usage: assert_ttl(key, ttl) without return types