<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _post_activity(self, activity, unserialize=True):
 """ Posts a activity to feed """

        # I think we always want to post to feed
        feed_url = "{proto}://{server}/api/user/{username}/feed".format(
            proto=self._pump.protocol,
            server=self._pump.client.server,
            username=self._pump.client.nickname
        )

        data = self._pump.request(feed_url, method="POST", data=activity)

        if not data:
            return False

        if "error" in data:
            raise PumpException(data["error"])

        if unserialize:
            if "target" in data:
                # we probably want to unserialize target if it's there
                # true for collection.{add,remove}
                self.unserialize(data["target"])
            else:
                # copy activity attributes into object
                if "author" not in data["object"]:
                    data["object"]["author"] = data["actor"]
                for key in ["to", "cc", "bto", "bcc"]:
                    if key not in data["object"] and key in data:
                        data["object"][key] = data[key]

                self.unserialize(data["object"])

        return True