code: def set_lease(self, new_lease):
          
          if self.partition_context:
              self.partition_context.lease = new_lease
              self.partition_context.event_processor_context = new_lease.event_processor_context
docs: Sets a new partition lease to be processed by the pump.
  
          :param lease: The lease to set.
          :type lease: ~azure.eventprocessorhost.lease.Lease