code: def build_stats(counts):
      
      stats = {
          'status': 0,
          'reportnum': counts['reportnum'],
          'title': counts['title'],
          'author': counts['auth_group'],
          'url': counts['url'],
          'doi': counts['doi'],
          'misc': counts['misc'],
      }
      stats_str = "%(status)s-%(reportnum)s-%(title)s-%(author)s-%(url)s-%(doi)s-%(misc)s" % stats
      stats["old_stats_str"] = stats_str
      stats["date"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
      stats["version"] = version
      return stats
docs: Return stats information from counts structure.