docstr: To add events to a projects
code: def add_event(
      self, context: AuthedServiceContext, project_event: ProjectEvent
  ) -> Union[SyftSuccess, SyftError]:
      """To add events to a projects"""
      # Event object should be received from the leader of the project
  
      # retrieve the project object by node verify key
      project_obj = self.stash.get_by_uid(
          context.node.verify_key, uid=project_event.project_id
      )
  
      if project_obj.is_ok():
          project: Project = project_obj.ok()
          if (
              project.state_sync_leader.verify_key
              == context.node.verify_key
          ):
              return SyftError(
                  message="Project Events should be passed to leader by broadcast endpoint"
              )
          if (
              context.credentials
              != project.state_sync_leader.verify_key
          ):
              return SyftError(
                  message="Only the leader of the project can add events"
              )
  
          project.events.append(project_event)
          project.event_id_hashmap[project_event.id] = project_event
  
          message_result = self.check_for_project_request(
              project, project_event, context
          )
          if isinstance(message_result, SyftError):
              return message_result
  
          # updating the project object using root verify key of node
          result = self.stash.update(context.node.verify_key, project)
  
          if result.is_err():
              return SyftError(message=str(result.err()))
          return SyftSuccess(
              message=f"Project event {project_event.id} added successfully "
          )
  
      if project_obj.is_err():
          return SyftError(message=str(project_obj.err()))
  
imports: from typing import List
  from typing import Union
  from ...serde.serializable import serializable
  from ...store.document_store import DocumentStore
  from ...store.linked_obj import LinkedObject
  from ...types.uid import UID
  from ...util.telemetry import instrument
  from ..context import AuthedServiceContext
  from ..notification.notification_service import NotificationService
  from ..notification.notifications import CreateNotification
  from ..response import SyftError
  from ..response import SyftNotReady
  from ..response import SyftSuccess
  from ..service import AbstractService
  from ..service import SERVICE_TO_TYPES
  from ..service import TYPE_TO_SERVICE
  from ..service import service_method
  from ..user.user_roles import GUEST_ROLE_LEVEL
  from ..user.user_roles import ONLY_DATA_SCIENTIST_ROLE_LEVEL
  from ..user.user_roles import ServiceRole
  from .project import Project
  from .project import ProjectEvent
  from .project import ProjectRequest
  from .project import ProjectSubmit
  from .project import create_project_hash
  from .project_stash import ProjectStash
label_desc: Use image node_id 4 for calling the ProjectService obj's underlying member method code with example usage: obj.add_event(context, project_event) and returns: SyftSuccess, SyftError, SyftError, SyftError, message_result, SyftError