input: Write a function to determine the winner of a rock-paper-scissors game between two players. The function should take two inputs representing the choices of the two players and return a string indicating the result of the game. Use predefined rules to decide the winner: rock beats scissors, scissors beats paper, and paper beats rock. If both players choose the same option, return 'It is a draw!'. If the input choices are not among 'rock', 'paper', or 'scissors', return 'Invalid input!'.
  
  def play_game(player1, player2):
      rules = {'rock': 'scissors', 'scissors': 'paper', 'paper': 'rock'}
      valid_choices = {'rock', 'paper', 'scissors'}
      if player1 not in valid_choices or player2 not in valid_choices:
          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', 'rock') == 'It is a draw!'
  assert play_game('scissors', 'rock') == 'Player 2 wins!'
  assert play_game('paper', 'scissors') == 'Player 2 wins!'
  assert play_game('rock', 'paper') == 'Player 2 wins!'
  assert play_game('rock', 'invalid') == 'Invalid input!'
  assert play_game('invalid', 'rock') == 'Invalid input!'
  assert play_game('invalid', 'invalid') == 'Invalid input!'
  assert play_game('', '') == 'Invalid input!'
output: def play_game(player1, player2):
      rules = {'rock': 'scissors', 'scissors': 'paper', 'paper': 'rock'}
      valid_choices = {'rock', 'paper', 'scissors'}
      if player1 not in valid_choices or player2 not in valid_choices:
          return 'Invalid input!'
      if player1 == player2:
          return 'It is a draw!'
      elif rules[player1] == player2:
          return 'Player 1 wins!'
      else:
          return 'Player 2 wins!'