def _NeedsIndexes(func):
 def UpdateIndexesWrapper(self, *args, **kwargs):
  self._SetupIndexes()
  try:
   return func(self, *args, **kwargs)
  finally:
   self._UpdateIndexes()
 return UpdateIndexesWrapper

def _NeedsIndexes ( func ) : def UpdateIndexesWrapper ( self , * args , ** kwargs ) : self . _SetupIndexes ( ) try : return func ( self , * args , ** kwargs ) finally : self . _UpdateIndexes ( ) return UpdateIndexesWrapper
a decorator for datastorestub methods that require or affect indexes .