code: def add_identities(cls, db, identities, backend):
          logger.info("Adding the identities to SortingHat")
          total = 0
          for identity in identities:
              try:
                  cls.add_identity(db, identity, backend)
                  total += 1
              except Exception as e:
                  logger.error("Unexcepted error when adding identities: %s" % e)
                  continue
          logger.info("Total identities added to SH: %i", total)