code: def user_activity_stats(self, username, format=None):
          
          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
docs: 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.