import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
keyword = "global test"
fpath = ""
context = []
f = open(fpath,'r')
for line in f.readlines():
    if keyword in line:     
        context.append(line)
    else:
        continue
evaluationList = []
heads = []
middles = []
tails = []
for i in range(len(context)):
    evaluationList.append(float(context[i].split(" ")[-2]))
loc = 0
max_item = 0
for i in range(len(evaluationList)):
    if evaluationList[i] > max_item:
        max_item = evaluationList[i] 
        loc = i
print("File \"{0}\" containing keyword \"{1}\" reaches to \"{2}\"".format(fpath.split('/')[-1], keyword, max(evaluationList)))
print(context[loc])