<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def user_activity_stats(self, username, format=None):
 """ Retrieve the activity stats about a specific user over the last year. Params: username (string):
 filters the username of the user whose activity you are interested in. format (string):
 Allows changing the of the date/time returned from iso format to unix timestamp Can be: timestamp or isoformat Returns: dict: A dictionary of activities done by a given user for all the projects for a given Pagure instance. """

        request_url = "{}/api/0/user/{}/activity/stats".format(self.instance, username)

        payload = {}
        if username is not None:
            payload['username'] = username
        if format is not None:
            payload['format'] = format

        return_value = self._call_api(request_url, params=payload)

        return return_value