docs: def save_file_revisions(self,snapshot,file_revisions):
          """
          We convert various items in the file revision to documents,
          so that we can easily search and retrieve them...
          """
  
          annotations = defaultdict(list)
  
          for file_revision in file_revisions:
              issues_results = {}
  
              for analyzer_name,results in file_revision.results.items():
  
                  if 'issues' in results:
                      issues_results[analyzer_name] = results['issues']
                      del results['issues']
                      if len(issues_results) > 1000:
                          issues_results[analyzer_name] = [{
                                  'code' : 'TooManyIssues',
                                  'analyzer' : analyzer_name,
                              }]
  
              with self.project.backend.transaction():
                  self.project.backend.save(file_revision)
  
              def location_sorter(issue):
                  if issue['location'] and issue['location'][0] and issue['location'][0][0]:
                      return issue['location'][0][0][0]
                  return 0
  
              with self.project.backend.transaction():
                  for analyzer_name,issues in issues_results.items():
                      grouped_issues = group_issues_by_fingerprint(issues)
                      for issue_dict in grouped_issues:
  
                          hasher = Hasher()
                          hasher.add(analyzer_name)
                          hasher.add(issue_dict['code'])
                          hasher.add(issue_dict['fingerprint'])
                          issue_dict['hash'] = hasher.digest.hexdigest()
  
                          try:
                              #we check if the issue already exists
                              issue = self.project.backend.get(Issue,{'hash' : issue_dict['hash'],
                                                                      'project' : self.project
                                                                     })
                          except Issue.DoesNotExist:
                              #if not, we create it
                              d = issue_dict.copy()
                              d['analyzer'] = analyzer_name
                              if 'location' in d:
                                  del d['location']
                              if 'occurrences' in d:
                                  del d['occurrences']
                              issue = Issue(d)
                              issue.project = self.project
                              self.project.backend.save(issue)
  
                          for occurrence in issue_dict['occurrences']:
                              hasher = Hasher()
                              hasher.add(file_revision.hash)
                              hasher.add(issue.hash)
                              hasher.add(occurrence.get('from_row'))
                              hasher.add(occurrence.get('from_column'))
                              hasher.add(occurrence.get('to_row'))
                              hasher.add(occurrence.get('to_column'))
                              hasher.add(occurrence.get('sequence'))
                              occurrence['hash'] = hasher.digest.hexdigest()
  
                              try:
                                  #we check if the occurrence already exists
                                  occurrence = self.project.backend.get(IssueOccurrence,{'hash' : occurrence['hash'],
                                                                                         'issue' : issue
                                                                                        })
                              except IssueOccurrence.DoesNotExist:
                                  #if not, we create it
                                  occurrence = IssueOccurrence(occurrence)
                                  occurrence.issue = issue
                                  occurrence.file_revision = file_revision
                                  self.project.backend.save(occurrence)
                              annotations['occurrences'].append(occurrence)
                          annotations['issues'].append(issue)
  
          return annotations