def chunk(keywords, lines):
    """
    Divide a file into chunks between
    key words in the list
    """
    chunks = dict()
    chunk = []
      
    # Create an empty dictionary using all the keywords
    for keyword in keywords:
        chunks[keyword] = []
    
    # Populate dictionary with lists of chunks associated
    # with the keywords in the list   
    for line in lines:
        if line.strip():
            token = line.split()[0]
            if token in keywords:
                chunk = [line]   
                chunks[token].append(chunk)   
            else:
                chunk.append(line)

    return chunks
Divide a file into chunks between
    key words in the list