code: def strip_boolean_result(method, exc_type=None, exc_str=None, fail_ret=None):
      
      @wraps(method)
      def wrapped(*args, **kwargs):
          ret = method(*args, **kwargs)
          if ret[0]:
              if len(ret) == 2:
                  return ret[1]
              else:
                  return ret[1:]
          else:
              if exc_type:
                  raise exc_type(exc_str or 'call failed')
              return fail_ret
      return wrapped
docs: Translate method's return value for stripping off success flag.
  
      There are a lot of methods which return a "success" boolean and have
      several out arguments. Translate such a method to return the out arguments
      on success and None on failure.