import random


def get_initators(filepath, n_lines):
    """
    Open text file with iniator words and sample random iniator for each line in the poem. 
    """
    with open(filepath, "r", encoding = "utf-8") as file:
        # save indices of all keywords
        loaded_text = file.read() # load text file
        lines = loaded_text.splitlines() # seperate initiator lines
        initiators_list = list(random.sample(lines, n_lines)) # sample random initators
    return initiators_list