docstr: To add events to a projects
code: def broadcast_event(
      self, context: AuthedServiceContext, project_event: ProjectEvent
  ) -> Union[SyftSuccess, SyftError]:
      """To add events to a projects"""
      # Only the leader of the project could add events to the projects
      # Any Event to be added to the project should be sent to the leader of the project
      # The leader broadcasts the event to all the members of the project
  
      project_obj = self.stash.get_by_uid(
          context.node.verify_key, uid=project_event.project_id
      )
  
      if project_obj.is_err():
          return SyftError(message=str(project_obj.err()))
  
      project = project_obj.ok()
  
      if not project.has_permission(context.credentials):
          return SyftError(
              message="User does not have permission to add events"
          )
  
      project: Project = project_obj.ok()
      if (
          project.state_sync_leader.verify_key
          != context.node.verify_key
      ):
          return SyftError(
              message="Only the leader of the project can broadcast events"
          )
  
      if (
          project_event.seq_no <= len(project.events)
          and len(project.events) > 0
      ):
          return SyftNotReady(message="Project out of sync event")
      if project_event.seq_no > len(project.events) + 1:
          return SyftError(message="Project event out of order!")
  
      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
  
      # Broadcast the event to all the members of the project
      network_service = context.node.get_service("networkservice")
      for member in project.members:
          if member.verify_key != context.node.verify_key:
              # Retrieving the NodePeer Object to communicate with the node
              peer = network_service.stash.get_for_verify_key(
                  credentials=context.node.verify_key,
                  verify_key=member.verify_key,
              )
  
              if peer.is_err():
                  return SyftError(
                      message=f"Leader node does not have peer {member.name}-{member.id.short()}"
                      + " Kindly exchange routes with the peer"
                  )
              peer = peer.ok()
              client = peer.client_with_context(context)
              event_result = client.api.services.project.add_event(
                  project_event
              )
              if isinstance(event_result, SyftError):
                  return event_result
  
      result = self.stash.update(context.node.verify_key, project)
  
      if result.is_err():
          return SyftError(message=str(result.err()))
      return SyftSuccess(message="Successfully Broadcasted Event")
  
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 5 for calling the ProjectService obj's underlying member method code with example usage: obj.broadcast_event(context, project_event) and returns: SyftSuccess, SyftError, SyftError, SyftError, SyftNotReady, SyftError, message_result, SyftError, SyftError, event_result