There are several items that are dubious at best. Why would you use no_duplicates = list(dict.fromkeys( )) instead of no_duplicates = list(set( )) ?
>>> list(dict.fromkeys([3, 2, 1])) [3, 2, 1] >>> list(set([3, 2, 1])) [1, 2, 3]
That's why there's OrderredDict.
Unless the language explicitly says that dicts hold their order, even if they do, it's an implementation detail, and it should not be relied upon.