def _contents(self, method, *args):
        '''
        common backend for methods:
        keys, values, items, __len__, __contains__
        '''
        try:
            self._lock.acquire()
            self.prune()

            data = getattr(self._data, method)(*args)
            return data

        finally:
            self._lock.release()

        common backend for methods:
        keys, values, items, __len__, __contains__
        
recipes/Python/498266_selfcleaning_dictlike_container_which_limits/recipe-498266.py