def _get_custom_cache_region(expiration_time=WEEK, backend=None, url=None):
 region = cache.create_region()
 region_params = {}
 if (expiration_time != 0):
  region_params['expiration_time'] = expiration_time
 if (backend == 'oslo_cache.dict'):
  region_params['arguments'] = {'expiration_time': expiration_time}
 elif (backend == 'dogpile.cache.memcached'):
  region_params['arguments'] = {'url': url}
 else:
  raise RuntimeError(_('old style configuration can use only dictionary or memcached backends'))
 region.configure(backend, **region_params)
 return region

def _get_custom_cache_region ( expiration_time = WEEK , backend = None , url = None ) : region = cache . create_region ( ) region_params = { } if ( expiration_time != 0 ) : region_params [ 'expiration_time' ] = expiration_time if ( backend == 'oslo_cache.dict' ) : region_params [ 'arguments' ] = { 'expiration_time' : expiration_time } elif ( backend == 'dogpile.cache.memcached' ) : region_params [ 'arguments' ] = { 'url' : url } else : raise RuntimeError ( _ ( 'old style configuration can use only dictionary or memcached backends' ) ) region . configure ( backend , ** region_params ) return region
create instance of oslo_cache client .