def lru_timestamp(refresh_interval=60):
    """ Return a timestamp string for @lru_cache decorated functions.

    The returned timestamp is used as the value of an extra parameter
    to @lru_cache decorated functions, allowing for more control over
    how often cache entries are refreshed. The lru_timestamp function
    should be called with the same refresh_interval value for a given
    @lru_cache decorated function.  The returned timestamp is for the
    benefit of the @lru_cache decorator and is normally not used by
    the decorated function.

    Positional arguments:
    refresh_interval -- in minutes (default 60), values less than 1
                        are coerced to 1, values more than 1440 are
                        coerced to 1440

    """

    if not isinstance(refresh_interval, int):
        raise TypeError('refresh_interval must be an int from 1-1440')

    dt = datetime.datetime.now()

    if refresh_interval > 60:
        refresh_interval = min(refresh_interval, 60*24)
        fmt = '%Y%m%d'
        minutes = dt.hour * 60
    else:
        refresh_interval = max(1, refresh_interval)
        fmt = '%Y%m%d%H'
        minutes = dt.minute

    ts = dt.strftime(fmt)
    age = minutes // refresh_interval
    return '{0}:{1:d}'.format(ts, age)
 Return a timestamp string for @lru_cache decorated functions.

    The returned timestamp is used as the value of an extra parameter
    to @lru_cache decorated functions, allowing for more control over
    how often cache entries are refreshed. The lru_timestamp function
    should be called with the same refresh_interval value for a given
    @lru_cache decorated function.  The returned timestamp is for the
    benefit of the @lru_cache decorator and is normally not used by
    the decorated function.

    Positional arguments:
    refresh_interval -- in minutes (default 60), values less than 1
                        are coerced to 1, values more than 1440 are
                        coerced to 1440

    
recipes/Python/578817_lrutimestamp__cache_entry_aging/recipe-578817.py