input: Write a python function to check if a password is valid based on given criteria.
  assert is_valid_password("Password123") == True
  assert is_valid_password("password") == False
  assert is_valid_password("PASSWORD123") == False
  assert is_valid_password("Pass123") == False
  assert is_valid_password("P@ssw0rd") == True
output: def is_valid_password(password: str) -> bool:
      if len(password) < 8:
          return False
      has_upper = any(char.isupper() for char in password)
      has_lower = any(char.islower() for char in password)
      has_digit = any(char.isdigit() for char in password)
      has_special = any(not char.isalnum() for char in password)
      return has_upper and has_lower and has_digit and has_special