input: from typing import List, Union
  
  def generate_random_string(length: int = 8) -> str:
      """ Generate a random string of the specified length made of uppercase letters and numbers.
      >>> generate_random_string()
      'A3B5F7H9'
      >>> generate_random_string(10)
      '3D2F1E8G7H'
      """
      import string
      import random
      chars = string.ascii_uppercase + string.digits
      return ''.join(random.choice(chars) for _ in range(length))
output:     import string
      import random
      chars = string.ascii_uppercase + string.digits
      return ''.join(random.choice(chars) for _ in range(length))