code: def register_scope(self, scope):
          
          if not isinstance(scope, Scope):
              raise TypeError("Invalid scope type.")
          assert scope.id not in self.scopes
          self.scopes[scope.id] = scope
docs: Register a scope.
  
          :param scope: A :class:`invenio_oauth2server.models.Scope` instance.