import string
import random


def generate_filename(size=10, chars=string.ascii_uppercase + string.digits, extension='png'):
  """Creates random filename

    Args:
        size: length of the filename part, without dot and extention
        chars: character range to draw random characters from
        extension: extension to be added to the returned filenam

    Returns:
        random filame with extension

    """
  filename = ''.join(random.choice(chars) for _ in range(size))
  return filename + '.' + extension