code: def lease(self, ttl, lease_id=None):
          
          lease_grant_request = etcdrpc.LeaseGrantRequest(TTL=ttl, ID=lease_id)
          lease_grant_response = self.leasestub.LeaseGrant(
              lease_grant_request,
              self.timeout,
              credentials=self.call_credentials,
              metadata=self.metadata
          )
          return leases.Lease(lease_id=lease_grant_response.ID,
                              ttl=lease_grant_response.TTL,
                              etcd_client=self)
docs: Create a new lease.
  
          All keys attached to this lease will be expired and deleted if the
          lease expires. A lease can be sent keep alive messages to refresh the
          ttl.
  
          :param ttl: Requested time to live
          :param lease_id: Requested ID for the lease
  
          :returns: new lease
          :rtype: :class:`.Lease`