input: Write a function to generate a random password.
  assert len(generate_password()) == 10
  assert any(char.isdigit() for char in generate_password())
  assert any(char.isalpha() for char in generate_password())
  assert any(char in string.punctuation for char in generate_password())
output: import random
  import string
  
  def generate_password():
      all_characters = string.ascii_letters + string.digits + string.punctuation
      password = ''.join(random.choice(all_characters) for _ in range(10))
      
      # Ensure at least one digit, one alpha, and one punctuation is included
      if (any(char.isdigit() for char in password) and
          any(char.isalpha() for char in password) and
          any(char in string.punctuation for char in password)):
          return password
      else:
          return generate_password()