<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def subscribe( 		self, 		plan, 		charge_immediately=True, 		application_fee_percent=None, 		coupon=None, 		quantity=None, 		metadata=None, 		tax_percent=None, 		billing_cycle_anchor=None, 		trial_end=None, 		trial_from_plan=None, 		trial_period_days=None, 	):
 		""" 		Subscribes this customer to a plan. 		:param plan: The plan to which to subscribe the customer. 		:type plan: Plan or string (plan ID) 		:param application_fee_percent: This represents the percentage of the subscription invoice subtotal 			that will be transferred to the application owner's Stripe account. 			The request must be made with an OAuth key in order to set an 			application fee percentage. 		:type application_fee_percent: Decimal. Precision is 2; anything more will be ignored. A positive 			decimal between 1 and 100. 		:param coupon: The code of the coupon to apply to this subscription. A coupon applied to a subscription 			will only affect invoices created for that particular subscription. 		:type coupon: string 		:param quantity: The quantity applied to this subscription. Default is 1. 		:type quantity: integer 		:param metadata: A set of key/value pairs useful for storing additional information. 		:type metadata: dict 		:param tax_percent: This represents the percentage of the subscription invoice subtotal that will 			be calculated and added as tax to the final amount each billing period. 		:type tax_percent: Decimal. Precision is 2; anything more will be ignored. A positive decimal 			between 1 and 100. 		:param billing_cycle_anchor: A future timestamp to anchor the subscription’s billing cycle. 			This is used to determine the date of the first full invoice, and, 			for plans with month or year intervals, the day of the month for 			subsequent invoices. 		:type billing_cycle_anchor: datetime 		:param trial_end: The end datetime of the trial period the customer will get before being charged for 			the first time. If set, this will override the default trial period of the plan the 			customer is being subscribed to. The special value ``now`` can be provided to end 			the customer's trial immediately. 		:type trial_end: datetime 		:param charge_immediately: Whether or not to charge for the subscription upon creation. If False, an 			invoice will be created at the end of this period. 		:type charge_immediately: boolean 		:param trial_from_plan: Indicates if a plan’s trial_period_days should be applied to the subscription. 			Setting trial_end per subscription is preferred, and this defaults to false. 			Setting this flag to true together with trial_end is not allowed. 		:type trial_from_plan: boolean 		:param trial_period_days: Integer representing the number of trial period days before the customer is 			charged for the first time. This will always overwrite any trials that might 			apply via a subscribed plan. 		:type trial_period_days: integer 		.. Notes: 		.. ``charge_immediately`` is only available on ``Customer.subscribe()`` 		.. if you're using ``Customer.subscribe()`` instead of ``Customer.subscribe()``, ``plan`` \ 		can only be a string 		"""

		from .billing import Subscription

		# Convert Plan to id
		if isinstance(plan, StripeModel):
			plan = plan.id

		stripe_subscription = Subscription._api_create(
			plan=plan,
			customer=self.id,
			application_fee_percent=application_fee_percent,
			coupon=coupon,
			quantity=quantity,
			metadata=metadata,
			billing_cycle_anchor=billing_cycle_anchor,
			tax_percent=tax_percent,
			trial_end=trial_end,
			trial_from_plan=trial_from_plan,
			trial_period_days=trial_period_days,
		)

		if charge_immediately:
			self.send_invoice()

		return Subscription.sync_from_stripe_data(stripe_subscription)