Generates a random excuse from a simple template dict.

    Based off of drow's generator.js (public domain).
    Grok it here: http://donjon.bin.sh/code/random/generator.js

    Args:
        template_dict: Dict with template strings.
        key: String with the starting index for the dict. (Default: 'start')

    Returns:
        Generated string.

def generate_random_string(template_dict, key='start'):
    """Generates a random excuse from a simple template dict.

    Based off of drow's generator.js (public domain).
    Grok it here: http://donjon.bin.sh/code/random/generator.js

    Args:
        template_dict: Dict with template strings.
        key: String with the starting index for the dict. (Default: 'start')

    Returns:
        Generated string.
    """

    data = template_dict.get(key)

    #if isinstance(data, list):
    result = random.choice(data)
    #else:
        #result = random.choice(data.values())

    for match in token_regex.findall(result):
        word = generate_random_string(template_dict, match) or match
        result = result.replace('{{{0}}}'.format(match), word)

    return result