input: Write a function to simulate a decision-making algorithm for a rock-paper-scissors game using Python. The function should take two inputs, player1 and player2, representing their choices, and return the result of the game. The result should indicate either 'Player 1 wins!', 'Player 2 wins!', or 'It is a draw!' if both players make the same choice. If an invalid choice is made, the function should handle it gracefully.
  
  def play_game(player1, player2):
      # Define the winning rules
      rules = {'rock': 'scissors', 'scissors': 'paper', 'paper': 'rock'}
      if player1 == player2:
          return 'It is a draw!'
      elif player1 in rules and rules[player1] == player2:
          return 'Player 1 wins!'
      elif player2 in rules and rules[player2] == player1:
          return 'Player 2 wins!'
      else:
          return 'Invalid input!'
  
  assert play_game('rock', 'scissors') == 'Player 1 wins!'
  assert play_game('scissors', 'rock') == 'Player 2 wins!'
  assert play_game('rock', 'rock') == 'It is a draw!'
  assert play_game('paper', 'scissors') == 'Player 2 wins!'
  assert play_game('rock', '') == 'Invalid input!'
output: def play_game(player1, player2):
      rules = {'rock': 'scissors', 'scissors': 'paper', 'paper': 'rock'}
      if player1 == player2:
          return 'It is a draw!'
      elif player1 in rules and rules[player1] == player2:
          return 'Player 1 wins!'
      elif player2 in rules and rules[player2] == player1:
          return 'Player 2 wins!'
      else:
          return 'Invalid input!'