def delete_subscription(self, project, subscription,<EOL>fail_if_not_exists=False):
service = self.get_conn()<EOL>full_subscription = _format_subscription(project, subscription)<EOL>try:<EOL><INDENT>service.projects().subscriptions().delete(<EOL>subscription=full_subscription).execute(num_retries=self.num_retries)<EOL><DEDENT>except HttpError as e:<EOL><INDENT>if str(e.resp['<STR_LIT:status>']) == '<STR_LIT>':<EOL><INDENT>message = '<STR_LIT>'.format(<EOL>full_subscription)<EOL>self.log.warning(message)<EOL>if fail_if_not_exists:<EOL><INDENT>raise PubSubException(message)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise PubSubException(<EOL>'<STR_LIT>'.format(full_subscription),<EOL>e)<EOL><DEDENT><DEDENT>
Deletes a Pub/Sub subscription, if it exists.

        :param project: the GCP project ID where the subscription exists
        :type project: str
        :param subscription: the Pub/Sub subscription name to delete; do not
            include the ``projects/{project}/subscriptions/`` prefix.
        :type subscription: str
        :param fail_if_not_exists: if set, raise an exception if the topic
            does not exist
        :type fail_if_not_exists: bool