code: def fi_ssn(ssn, allow_temporal_ssn=True):
      
      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 (
          int(gd['serial']) >= 2 and
          (allow_temporal_ssn or int(gd['serial']) <= 899) and
          ssn_checkmarks[checksum % len(ssn_checkmarks)] ==
          gd['checksum']
      )
docs: Validate a Finnish Social Security Number.
  
      This validator is based on `django-localflavor-fi`_.
  
      .. _django-localflavor-fi:
          https://github.com/django/django-localflavor-fi/
  
      Examples::
  
          >>> fi_ssn('010101-0101')
          True
  
          >>> fi_ssn('101010-0102')
          ValidationFailure(func=fi_ssn, args=...)
  
      .. versionadded:: 0.5
  
      :param ssn: Social Security Number to validate
      :param allow_temporal_ssn:
          Whether to accept temporal SSN numbers. Temporal SSN numbers are the
          ones where the serial is in the range [900-999]. By default temporal
          SSN numbers are valid.