"""Generating a random story.
"""

import random
from typing import TextIO


def generate_random_story(data_file: TextIO, context_size: int,
                          num_words: int) -> str:
    """Return a randomly generated story with num_words words based on a
    context of context_size words from the text in data_file.
    """

    pass


# A helper function
def get_random_context(context_to_words: dict[tuple, list[str]]) -> tuple:
    """Return a random context (key) from context_to_words."""

    return random.choice(list(context_to_words.keys()))


if __name__ == '__main__':

    # import doctest
    # doctest.testmod()

    # with open('small.txt') as small:
    #    print(generate_random_story(small, 2, 10))

    # filename = input('Enter a filename: ')
    # with open(filename) as training_file:
    #     print(generate_random_story(training_file, 2, 50))
    pass
