input: Write a function to implement a decision-making algorithm for a rock-paper-scissors game using Python. The function takes two inputs, player1 and player2, which are the choices made by two players. It returns a string indicating the result of the game, either 'It is a draw!', 'Player 1 wins!', or 'Player 2 wins!'. If the inputs are invalid, it should return 'Invalid input!'.
  
  def play_game(player1, player2):
      rules = {'rock': 'scissors', 'scissors': 'paper', 'paper': 'rock'}
      if player1 not in rules or player2 not in rules:
          return 'Invalid input!'
      if player1 == player2:
          return 'It is a draw!'
      elif rules[player1] == player2:
          return 'Player 1 wins!'
      else:
          return 'Player 2 wins!'
  
  assert play_game('rock', 'scissors')=='Player 1 wins!'
  assert play_game('scissors', 'paper')=='Player 1 wins!'
  assert play_game('paper', 'rock')=='Player 1 wins!'
  assert play_game('rock', 'paper')=='Player 2 wins!'
  assert play_game('scissors', 'rock')=='Player 2 wins!'
  assert play_game('paper', 'scissors')=='Player 2 wins!'
  assert play_game('rock', 'rock')=='It is a draw!'
  assert play_game('scissors', 'scissors')=='It is a draw!'
  assert play_game('paper', 'paper')=='It is a draw!'
  assert play_game('rock', 'invalid')=='Invalid input!'
  assert play_game('invalid', 'rock')=='Invalid input!'
  assert play_game('invalid', 'invalid')=='Invalid input!'
output: def play_game(player1, player2):
      rules = {'rock': 'scissors', 'scissors': 'paper', 'paper': 'rock'}
      if player1 not in rules or player2 not in rules:
          return 'Invalid input!'
      if player1 == player2:
          return 'It is a draw!'
      elif rules[player1] == player2:
          return 'Player 1 wins!'
      else:
          return 'Player 2 wins!'