@validator
def fi_ssn(ssn):
 if (not ssn):
  return False
 result = re.match(ssn_pattern, ssn)
 if (not result):
  return False
 gd = result.groupdict()
 checksum = int((gd['date'] + gd['serial']))
 return (ssn_checkmarks[(checksum % len(ssn_checkmarks))] == gd['checksum'].upper())

@ validator def fi_ssn ( ssn ) : if ( not ssn ) : return False result = re . match ( ssn_pattern , ssn ) if ( not result ) : return False gd = result . groupdict ( ) checksum = int ( ( gd [ 'date' ] + gd [ 'serial' ] ) ) return ( ssn_checkmarks [ ( checksum % len ( ssn_checkmarks ) ) ] == gd [ 'checksum' ] . upper ( ) )
validate a finnish social security number .