'Create a new LRUSizeCache.
:param max_size: The max number of bytes to store before we start
clearing out entries.
:param after_cleanup_size: After cleaning up, shrink everything to this
size.
:param compute_size: A function to compute the size of the values. We
use a function here, so that you can pass \'len\' if you are just
using simple strings, or a more complex function if you are using
something like a list of strings, or even a custom object.
The function should take the form "compute_size(value) => integer".
If not supplied, it defaults to \'len()\''

def __init__(self, max_size=(1024 * 1024), after_cleanup_size=None, compute_size=None):

    self._value_size = 0
    self._compute_size = compute_size
    if (compute_size is None):
        self._compute_size = len
    self._update_max_size(max_size, after_cleanup_size=after_cleanup_size)
    LRUCache.__init__(self, max_cache=max(int((max_size / 512)), 1))
