def METHOD_NAME(self, time_func=time.time):
    """Close any file handles that have been idle for longer than
    max_idle_time. time_func is primary used for testing.
    """
    if not self.cache:
        return
    cur_time = time_func()
    for name, fh_wrapper in list(self.cache.items()):
        if cur_time - fh_wrapper.last_accessed > self.max_idle_time:
            fh_wrapper.close()
        else:
            break