def scope_mode(self, scope, mode=None):
    if mode is None:
      # get scope mode
      return self.checkouts.checkouts[scope].mode if self.has_scope(scope) else None
    else:
      # update scope mode
      if self.has_scope(scope):
        self.checkouts.checkouts[scope].mode = mode
      else:
        raise InvalidOperation("scope '%s' has not been checkedout" % scope)
dataset/ETHPy150Open bloomreach/zinc/zinc.py/CheckoutState.scope_mode/original