input: Write a function to determine the winner of a rock-paper-scissors game between two players. The function should accept the choices of each player and return the result of the game as a string. If the choices are the same, the function should indicate a draw. If one player defeats the other based on the standard rules of rock-paper-scissors, the function should declare the winner. If an invalid choice is entered by either player, the function should return 'Invalid choice!'.
  
  def play_game(player1, player2):
      rules = {'rock': 'scissors', 'scissors': 'paper', 'paper': 'rock'}
      if player1 not in rules or player2 not in rules:
          return 'Invalid choice!'
      if player1 == player2:
          return 'It is a draw!'
      elif rules[player1] == player2:
          return 'Player 1 wins!'
      elif rules[player2] == player1:
          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', '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', 'paper')=='Player 2 wins!'
  assert play_game('scissors', 'rock')=='Player 2 wins!'
  assert play_game('paper', 'scissors')=='Player 2 wins!'
  assert play_game('rock', 'invalid')=='Invalid choice!'
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 choice!'
      if player1 == player2:
          return 'It is a draw!'
      elif rules[player1] == player2:
          return 'Player 1 wins!'
      elif rules[player2] == player1:
          return 'Player 2 wins!'