def parse(filename):

    if not os.path.exists(filename):
        raise Exception('No such file or directory: ' + filename)

    f = open(filename, 'rb')

    parameters = {}

    for line in f.readlines():
        if '=' in line:
            cols = line.split('=')
            value, key = cols[0].strip(), cols[1].strip()
            parameters[key.lower()] = smart_type(value)

    f.close()

    return parameters
Parse a parfile with each line following the format:
dataset/ETHPy150Open hyperion-rt/hyperion/hyperion/util/parfile.py/parse