<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extend(self, delta):
 		""" 		Extends this subscription by the provided delta. 		:param delta: The timedelta by which to extend this subscription. 		:type delta: timedelta 		"""


		if delta.total_seconds() < 0:
			raise ValueError("delta must be a positive timedelta.")

		if self.trial_end is not None and self.trial_end > timezone.now():
			period_end = self.trial_end
		else:
			period_end = self.current_period_end

		period_end += delta

		return self.update(prorate=False, trial_end=period_end)