def delegate_manager(method):
 @functools.wraps(method)
 def wrapped(self, *args, **kwargs):
  if self._base_manager:
   return getattr(self._base_manager, method.__name__)(*args, **kwargs)
  return method(self, *args, **kwargs)
 return wrapped

def delegate_manager ( method ) : @ functools . wraps ( method ) def wrapped ( self , * args , ** kwargs ) : if self . _base_manager : return getattr ( self . _base_manager , method . __name__ ) ( * args , ** kwargs ) return method ( self , * args , ** kwargs ) return wrapped
delegate method calls to base manager .