Check for duplicates in a sequence.
This function checks that a list contains no duplicates, by casting the list to a set and comparing the lengths. (This means that we cannot compare sequences containing unhashable types, like dictionaries and lists).
It raises an NineMLRuntimeError if the lengths are not equal.