code: def filter(self, u):
          
          if not isinstance(u, UniqueIdentity):
              raise ValueError("<u> is not an instance of UniqueIdentity")
  
          filtered = []
  
          for id_ in u.identities:
              email = None
  
              if self.sources and id_.source.lower() not in self.sources:
                  continue
  
              if self.strict:
                  if self._check_email(id_.email):
                      email = id_.email.lower()
              else:
                  email = id_.email.lower() if id_.email else None
  
              if email:
                  fid = EmailIdentity(id_.id, id_.uuid, email)
                  filtered.append(fid)
  
          return filtered
docs: Filter the valid identities for this matcher.
  
          :param u: unique identity which stores the identities to filter
  
          :returns: a list of identities valid to work with this matcher.
  
          :raises ValueError: when the unique identity is not an instance
              of UniqueIdentity class