'Configure a :class:`.CacheRegion`.
The :class:`.CacheRegion` itself
is returned.
:param backend:   Required.  This is the name of the
:class:`.CacheBackend` to use, and is resolved by loading
the class from the ``dogpile.cache`` entrypoint.
:param expiration_time:   Optional.  The expiration time passed
to the dogpile system.  May be passed as an integer number
of seconds, or as a ``datetime.timedelta`` value.
.. versionadded 0.5.0
``expiration_time`` may be optionally passed as a
``datetime.timedelta`` value.
The :meth:`.CacheRegion.get_or_create`
method as well as the :meth:`.CacheRegion.cache_on_arguments`
decorator (though note:  **not** the :meth:`.CacheRegion.get`
method) will call upon the value creation function after this
time period has passed since the last generation.
:param arguments: Optional.  The structure here is passed
directly to the constructor of the :class:`.CacheBackend`
in use, though is typically a dictionary.
:param wrap: Optional.  A list of :class:`.ProxyBackend`
classes and/or instances, each of which will be applied
in a chain to ultimately wrap the original backend,
so that custom functionality augmentation can be applied.
.. versionadded:: 0.5.0
.. seealso::
:ref:`changing_backend_behavior`'

def configure(self, backend, expiration_time=None, arguments=None, _config_argument_dict=None, _config_prefix=None, wrap=None):

    if ('backend' in self.__dict__):
        raise exception.RegionAlreadyConfigured(('This    region    is    already    configured    with    backend:    %s' % self.backend))
    backend_cls = _backend_loader.load(backend)
    if _config_argument_dict:
        self.backend = backend_cls.from_config_dict(_config_argument_dict, _config_prefix)
    else:
        self.backend = backend_cls((arguments or {}))
    if ((not expiration_time) or isinstance(expiration_time, Number)):
        self.expiration_time = expiration_time
    elif isinstance(expiration_time, datetime.timedelta):
        self.expiration_time = int(compat.timedelta_total_seconds(expiration_time))
    else:
        raise exception.ValidationError('expiration_time    is    not    a    number    or    timedelta.')
    if (self.key_mangler is None):
        self.key_mangler = self.backend.key_mangler
    self._lock_registry = NameRegistry(self._create_mutex)
    if getattr(wrap, '__iter__', False):
        for wrapper in reversed(wrap):
            self.wrap(wrapper)
    return self
