def _cache(bank, key, fun, **kwargs):
 items = cache.fetch(bank, key)
 if (items is None):
  items = {}
  try:
   item_list = fun(**kwargs)
  except CloudError as exc:
   log.warning('There was a cloud error calling {0} with kwargs {1}: {2}'.format(fun, kwargs, exc))
  for item in item_list:
   items[item.name] = object_to_dict(item)
  cache.store(bank, key, items)
 return items

def _cache ( bank , key , fun , ** kwargs ) : items = cache . fetch ( bank , key ) if ( items is None ) : items = { } try : item_list = fun ( ** kwargs ) except CloudError as exc : log . warning ( 'There was a cloud error calling {0} with kwargs {1}: {2}' . format ( fun , kwargs , exc ) ) for item in item_list : items [ item . name ] = object_to_dict ( item ) cache . store ( bank , key , items ) return items
cache an azure arm object .