code: def test_expiry(
      app_context: AppContext, cache: SupersetMetastoreCache
  ) -> None:
      delta = timedelta(days=90)
      dttm = datetime(2022, 3, 18, 0, 0, 0)
      with freeze_time(dttm):
          cache.set(
              FIRST_KEY,
              FIRST_KEY_INITIAL_VALUE,
              int(delta.total_seconds()),
          )
          assert cache.get(FIRST_KEY) == FIRST_KEY_INITIAL_VALUE
      with freeze_time(dttm + delta - timedelta(seconds=1)):
          assert cache.has(FIRST_KEY)
          assert cache.get(FIRST_KEY) == FIRST_KEY_INITIAL_VALUE
      with freeze_time(dttm + delta + timedelta(seconds=1)):
          assert cache.has(FIRST_KEY) is False
          assert cache.get(FIRST_KEY) is None
  
file_path: superset/tests/integration_tests/extensions/metastore_cache_test.py
imports: from __future__ import annotations
  from contextlib import nullcontext
  from datetime import datetime, timedelta
  from typing import Any, TYPE_CHECKING
  from uuid import UUID
  import pytest
  from flask.ctx import AppContext
  from freezegun import freeze_time
  from superset.key_value.exceptions import KeyValueCodecEncodeException
  from superset.key_value.types import JsonKeyValueCodec, KeyValueCodec, PickleKeyValueCodec
label_desc: Use image node_id 3 for calling a global function with example usage: test_expiry(app_context, cache) without return types