def file_to_list(path, unique=True):
    """ Split text file on lines, remove dups (if need), and return list of it """
    result = map(str.strip, open(path).readlines())
    if unique:
        result = set(result)

    return list(result)