def METHOD_NAME():
    ttl = 60  # 60s
    ttl_cache = TTLCache(ttl=ttl)
    now = maya.now()
    ttl_cache[1] = "a"
    ttl_cache[2] = "b"
    assert len(ttl_cache) == 2
    def maya_now_1():
        # pretend time has passed
        return now.add(seconds=ttl / 2)
    with patch("maya.now", maya_now_1):
        # items added later and will not be expired
        ttl_cache[3] = "c"
        ttl_cache[4] = "d"
        ttl_cache[5] = "e"
    assert len(ttl_cache) == 5
    cache_key_value_pairs = dict(ttl_cache.items())
    assert len(cache_key_value_pairs) == len(ttl_cache)
    assert cache_key_value_pairs[1] == "a"
    assert cache_key_value_pairs[2] == "b"
    assert cache_key_value_pairs[3] == "c"
    assert cache_key_value_pairs[4] == "d"
    assert cache_key_value_pairs[5] == "e"
    def maya_now_2():
        # pretend time has passed
        return now.add(seconds=ttl + 1)
    with patch("maya.now", maya_now_2):
        latest_cache_key_value_pairs = dict(ttl_cache.items())
        # 2 expired entries not returned
        assert len(latest_cache_key_value_pairs) == 3
        assert cache_key_value_pairs[3] == "c"
        assert cache_key_value_pairs[4] == "d"
        assert cache_key_value_pairs[5] == "e"