@validator
def fi_business_id(business_id):
 if ((not business_id) or (not re.match(business_id_pattern, business_id))):
  return False
 factors = [7, 9, 10, 5, 8, 4, 2]
 numbers = map(int, business_id[:7])
 checksum = int(business_id[8])
 sum_ = sum(((f * n) for (f, n) in zip(factors, numbers)))
 modulo = (sum_ % 11)
 return (((11 - modulo) == checksum) or ((modulo == 0) and (checksum == 0)))

@ validator def fi_business_id ( business_id ) : if ( ( not business_id ) or ( not re . match ( business_id_pattern , business_id ) ) ) : return False factors = [ 7 , 9 , 10 , 5 , 8 , 4 , 2 ] numbers = map ( int , business_id [ : 7 ] ) checksum = int ( business_id [ 8 ] ) sum_ = sum ( ( ( f * n ) for ( f , n ) in zip ( factors , numbers ) ) ) modulo = ( sum_ % 11 ) return ( ( ( 11 - modulo ) == checksum ) or ( ( modulo == 0 ) and ( checksum == 0 ) ) )
validate a finnish business id .