def is_isbn13(s):
  """
  Check whether the given string is a valid, normalized ISBN-13 number.

  This only passes if the given value is a string that has exactly 13
  decimal digits, and the last decimal digit is a proper ISBN-13 check
  digit.

  Parameters:

    s : str | mixed - the value to check

  Return:

    True if a valid, normalized ISBN-13 number, False otherwise
  """
  
  # Fail if not a string
  if not isinstance(s, str):
    return False
  
  # Fail if not exactly 13 characters
  if len(s) != 13:
    return False
  
  # Check that each character is a decimal digit and compute the
  # weighted sum as we go along
  wsum = 0
  for x in range(0, 13):
    
    # Get current character code
    c = ord(s[x])
    
    # Fail if not a decimal digit
    if (c < ord('0')) or (c > ord('9')):
      return False
    
    # Get proper weight for this digit
    w = 1
    if (x & 0x1) == 1:
      w = 3
    
    # Update weighted sum
    wsum = wsum + (w * (c - ord('0')))
  
  # If weighted sum mod 10 is zero, then check passes; otherwise, check
  # fails
  if (wsum % 10) == 0:
    return True
  else:
    return False