<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _delete_state(self, activity, agent, state_id=None, registration=None, etag=None):
 """Private method to delete a specified state from the LRS :param activity: Activity object of state to be deleted :type activity: :class:`tincan.activity.Activity` :param agent: Agent object of state to be deleted :type agent: :class:`tincan.agent.Agent` :param state_id: UUID of state to be deleted :type state_id: str | unicode :param registration: registration UUID of state to be deleted :type registration: str | unicode :param etag: etag of state to be deleted :type etag: str | unicode :return: LRS Response object with deleted state as content :rtype: :class:`tincan.lrs_response.LRSResponse` """

        if not isinstance(activity, Activity):
            activity = Activity(activity)

        if not isinstance(agent, Agent):
            agent = Agent(agent)

        request = HTTPRequest(
            method="DELETE",
            resource="activities/state"
        )

        if etag is not None:
            request.headers["If-Match"] = etag

        request.query_params = {
            "activityId": activity.id,
            "agent": agent.to_json(self.version)
        }
        if state_id is not None:
            request.query_params["stateId"] = state_id

        if registration is not None:
            request.query_params["registration"] = registration

        lrs_response = self._send_request(request)

        return lrs_response