docstr: To fetch unsynced events from the project
code: def sync(
      self, context: AuthedServiceContext, project_id: UID, seq_no: int
  ) -> Union[SyftSuccess, SyftError, List[ProjectEvent]]:
      """To fetch unsynced events from the project"""
      # 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_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 synced only with the leader"
              )
  
          if not project.has_permission(context.credentials):
              return SyftError(
                  message="User does not have permission to sync events"
              )
  
          if seq_no < 0:
              return SyftError(
                  message="Input seq_no should be a non negative integer"
              )
  
          # retrieving unsycned events based on seq_no
          return project.events[seq_no:]
  
      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 6 for calling the ProjectService obj's underlying member method code with example usage: obj.sync(context, project_id, seq_no) and returns: project, SyftError, SyftError, SyftError, SyftError