import random
import string


def generate_random_string(length=6):
    """Generate a random string of upper case letters and digits.

  Args:
    length: length of the generated string

  Returns:
    the generated string
  """
    return ''.join([
        random.choice(string.ascii_uppercase + string.digits)
        for _ in range(length)])