<s> import re <EOL> from . utils import validator <EOL> regex = ( <EOL> r'<STR_LIT>' <EOL> ) <EOL> pattern = re . compile ( regex ) <EOL> def char_value ( char ) : <EOL> """<STR_LIT>""" <EOL> if char . isdigit ( ) : <EOL> return int ( char ) <EOL> else : <EOL> return <NUM_LIT:10> + ord ( char ) - ord ( '<STR_LIT:A>' ) <EOL> def modcheck ( value ) : <EOL> """<STR_LIT>""" <EOL> rearranged = value [ <NUM_LIT:4> : ] + value [ : <NUM_LIT:4> ] <EOL> converted = [ char_value ( char ) for char in rearranged ] <EOL> integerized = int ( '<STR_LIT>' . join ( [ str ( i ) for i in converted ] ) ) <EOL> return ( integerized % <NUM_LIT> == <NUM_LIT:1> ) <EOL> @ validator <EOL> def iban ( value ) : <EOL> """<STR_LIT>""" <EOL> return pattern . match ( value ) and modcheck ( value ) </s>
