code: def export_identities(self, outfile, source=None):
          
          exporter = SortingHatIdentitiesExporter(self.db)
  
          dump = exporter.export(source)
  
          try:
              outfile.write(dump)
              outfile.write('\n')
          except IOError as e:
              raise RuntimeError(str(e))
  
          return CMD_SUCCESS
docs: Export identities information to a file.
  
          The method exports information related to unique identities, to
          the given 'outfile' output file.
  
          When 'source' parameter is given, only those unique identities which have
          one or more identities from the given source will be exported.
  
          :param outfile: destination file object
          :param source: source of the identities to export