@classmethod
    def isEmail(cls, s):
        """
        Test if s is a valid email adres.
        Testing is done on:
        - pattern
        - Only one @
        - No characters > 127 in user
        - No characters > 127 in domain
        - Valid user name pattern
        - Valid ip number pattern
        - Valid domain name pattern
        
            >>> v = Validator()
            >>> v.isEmail('"aaa"@bbb123.com')
            True
            >>> v.isEmail('aaa@bbb.com')
            True
            >>> v.isEmail('aaa@www.bbb.com')
            True
            >>> v.isEmail('aaa@www.bbb.nl')
            True
            >>> v.isEmail('aaa.xxx@bbb.com')
            True
            >>> v.isEmail('buro@petr.com')
            True
            >>> v.isEmail('xxx-sss@abc.nl')
            True
            >>> v.isEmail('xxx-sss@100.100.100.100')
            True
            >>> v.isEmail('xxx-sss@abc.co')
            True
            >>> v.isEmail('xxx-sss@a.a.a.a.a.a.a.a.a.a.a.a.co')
            True
            >>> v.isEmail('~xxx._._._sss@a.a.a.a.a.a.a.a.a.a.a.a.co')
            True
            >>> v.isEmail('<xxx-sss@abc.nl>')
            False
            >>> v.isEmail('x###xx-sss@abc.nl')
            False
            >>> v.isEmail('xxx-sss@abc.nlxxxx')
            False
            >>> v.isEmail('xxx-sss@abc.55')
            False
            >>> v.isEmail('xxx-sss@abc.55')
            False
            >>> v.isEmail('xxx-sss@222.444.555.666')
            False
            >>> v.isEmail('xxx-sss@100,aaa,100,100')
            False
            >>> v.isEmail('')
            False
            >>> v.isEmail(None)
            False
        """
        if not s:                                                    # Some extra safety
            return False
        try:
            split = re.findall(cls.EMAILPATTERN, s)[0]
        except __HOLE__:
            #print '[%s] Wrong email pattern' % s                    # Totally wrong pattern
            return False
            
        if len(split) != 2:
            #print '[%s] Wrong @ pattern' % s
            return False
        user, domain = split

        for c in user:                                                # Test user name characters on > 127
            if ord(c) > 127:
                #print '[%s] User character > 127' % user
                return False
        for c in domain:
            if ord(c) > 127:                                        # Test domain name characters on > 127
                #print '[%s] Domain character > 127' % user
                return False

        u1 = re.findall(cls.QUOTEDUSERPATTERN, user)
        u2 = re.findall(cls.USERPATTERN, user)
        if not (u1 or u2):
            #print '[%s] Wrong user pattern' % user
            return False
            
        
        ip = re.findall(cls.IPPATTERN, domain)                        # Test on ip number and domain name
        if ip:                                                        # Test if values in ip address are valid
            for t in ip[0]:
                v = int(t)
                if not (0 <= v <= 255):
                    #print '[%s] Not within 0-255 range' % domain    # Values not within 0-255 range
                    return False
                    
        d = re.findall(cls.DOMAINPATTERN, domain)        
        if not (ip or d):
            #print '[%s] Wrong domain pattern' % user
            return False
                
        return True
dataset/ETHPy150Open petrvanblokland/Xierpa3/xierpa3/toolbox/parsers/validator.py/Validator.isEmail