def file_format(path):
    """
    Return corresponding file format for a file
    (loop through all the lines, get maximum matched dictionary key)
    usage: input(file path)
    Format Usage with double equal  in control flow ==
    'Window(LF|CR)'  -> for Window MS(dos)
    'Unix/MacOS(LF)' -> for Linux, MacOS
    'Macintosh(CR)' -> for Older version of MacOS
    'Unknown' -> Undefined format
    """
    with open(path, 'rb') as f:
        carriage_dict = {'Unknown': 0, 'Window': 0, 'Linux': 0, 'Macintosh': 0}
        for index, line in enumerate(f, 1):
            if b'\r\n' in line:
                carriage_dict['Window'] += 1
            elif b'\n' in line:
                carriage_dict['Linux'] += 1
            elif b'\r' in line:
                carriage_dict['Macintosh'] += 1
            else:
                carriage_dict['Unknown'] += 1
        return max(carriage_dict, key=carriage_dict.get)
